mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-03 12:24:26 +02:00
refactor: workaround for clang bug added to unit_symbol()
and dimension_symbol()
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <mp-units/bits/dimension_concepts.h>
|
||||
#include <mp-units/bits/expression_template.h>
|
||||
#include <mp-units/bits/external/hacks.h>
|
||||
#include <mp-units/bits/external/type_traits.h>
|
||||
#include <mp-units/bits/module_macros.h>
|
||||
#include <mp-units/bits/symbol_text.h>
|
||||
@@ -305,7 +306,11 @@ template<typename CharT, std::size_t N, dimension_symbol_formatting fmt, Dimensi
|
||||
// TODO Refactor to `dimension_symbol(D, fmt)` when P1045: constexpr Function Parameters is available
|
||||
MP_UNITS_EXPORT template<dimension_symbol_formatting fmt = dimension_symbol_formatting{}, typename CharT = char,
|
||||
Dimension D>
|
||||
#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG <= 18
|
||||
[[nodiscard]] constexpr auto dimension_symbol(D)
|
||||
#else
|
||||
[[nodiscard]] consteval auto dimension_symbol(D)
|
||||
#endif
|
||||
{
|
||||
auto get_size = []() consteval {
|
||||
std::basic_string<CharT> buffer;
|
||||
|
@@ -25,6 +25,7 @@
|
||||
#include <mp-units/bits/expression_template.h>
|
||||
#include <mp-units/bits/external/algorithm.h>
|
||||
#include <mp-units/bits/external/fixed_string.h>
|
||||
#include <mp-units/bits/external/hacks.h>
|
||||
#include <mp-units/bits/external/type_name.h>
|
||||
#include <mp-units/bits/external/type_traits.h>
|
||||
#include <mp-units/bits/get_associated_quantity.h>
|
||||
@@ -826,7 +827,11 @@ template<typename CharT, std::size_t N, unit_symbol_formatting fmt, Unit U>
|
||||
|
||||
// TODO Refactor to `unit_symbol(U, fmt)` when P1045: constexpr Function Parameters is available
|
||||
MP_UNITS_EXPORT template<unit_symbol_formatting fmt = unit_symbol_formatting{}, typename CharT = char, Unit U>
|
||||
#if defined MP_UNITS_COMP_CLANG && MP_UNITS_COMP_CLANG <= 18
|
||||
[[nodiscard]] constexpr auto unit_symbol(U)
|
||||
#else
|
||||
[[nodiscard]] consteval auto unit_symbol(U)
|
||||
#endif
|
||||
{
|
||||
auto get_size = []() consteval {
|
||||
std::basic_string<CharT> buffer;
|
||||
|
Reference in New Issue
Block a user