mirror of
https://github.com/mpusz/mp-units.git
synced 2025-08-01 03:14:29 +02:00
refactor: unit_symbol
changed to consteval
This commit is contained in:
@@ -821,7 +821,7 @@ 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
|
// TODO Refactor to `unit_symbol(U, fmt)` when P1045: constexpr Function Parameters is available
|
||||||
template<unit_symbol_formatting fmt = unit_symbol_formatting{}, typename CharT = char, Unit U>
|
template<unit_symbol_formatting fmt = unit_symbol_formatting{}, typename CharT = char, Unit U>
|
||||||
[[nodiscard]] constexpr auto unit_symbol(U)
|
[[nodiscard]] consteval auto unit_symbol(U)
|
||||||
{
|
{
|
||||||
auto get_size = []() consteval {
|
auto get_size = []() consteval {
|
||||||
std::basic_string<CharT> buffer;
|
std::basic_string<CharT> buffer;
|
||||||
|
Reference in New Issue
Block a user