12#include <initializer_list>
19#include "gw/concepts.hpp"
20#include "gw/inplace_string.hpp"
27struct named_type_empty_base {
28 constexpr auto operator<=>(
const named_type_empty_base&)
const noexcept -> std::strong_ordering =
default;
44template <
typename T, basic_inplace_
string Name>
46 :
public std::conditional_t<std::ranges::range<T>, std::ranges::view_interface<named_type<T, Name>>,
47 detail::named_type_empty_base> {
64 template <
typename... Args>
65 constexpr explicit named_type(Args&&... args)
noexcept(std::is_nothrow_constructible_v<
value_type, Args...>)
66 requires std::constructible_from<value_type, Args...>
70 template <
typename U,
typename... Args>
71 constexpr named_type(std::initializer_list<U> ilist, Args&&... args)
noexcept(
72 std::is_nothrow_constructible_v<value_type, std::initializer_list<U>&, Args...>)
73 requires std::constructible_from<
value_type, std::initializer_list<U>&, Args...>
88 static constexpr auto
name() noexcept {
return Name.view(); }
119 constexpr auto value() const&& noexcept -> const
value_type&& {
return std::move(m_value); }
129 template <
typename F>
131 requires std::invocable<F, const_reference>
137 template <
typename F>
139 requires std::invocable<F, reference>
145 template <
typename F>
147 requires std::invocable<F, const value_type&&>
153 template <
typename F>
155 requires std::invocable<F, value_type&&>
165 constexpr void swap(
named_type& rhs)
noexcept(std::is_nothrow_swappable_v<value_type>)
166 requires std::swappable<value_type>
169 swap(m_value, rhs.m_value);
180 template <
typename... Args>
182 requires std::constructible_from<value_type, Args...>
184 m_value =
value_type{std::forward<Args>(args)...};
194 requires std::equality_comparable<value_type>
196 return m_value == rhs.m_value;
200 constexpr auto operator!=(
const named_type& rhs)
const&
noexcept(
noexcept(m_value != rhs.m_value)) ->
bool
201 requires std::equality_comparable<value_type>
203 return m_value != rhs.m_value;
208 requires std::totally_ordered<value_type>
210 return m_value < rhs.m_value;
215 requires std::totally_ordered<value_type>
217 return m_value > rhs.m_value;
221 constexpr auto operator<=(
const named_type& rhs)
const&
noexcept(
noexcept(m_value <= rhs.m_value)) ->
bool
222 requires std::totally_ordered<value_type>
224 return m_value <= rhs.m_value;
228 constexpr auto operator>=(
const named_type& rhs)
const&
noexcept(
noexcept(m_value >= rhs.m_value)) ->
bool
229 requires std::totally_ordered<value_type>
231 return m_value >= rhs.m_value;
235 constexpr auto operator<=>(
const named_type& rhs)
const&
noexcept(
noexcept(m_value <=>
236 rhs.m_value)) -> std::strong_ordering
237 requires std::three_way_comparable<value_type>
239 return m_value <=> rhs.m_value;
250 constexpr explicit operator reference() &
noexcept {
return m_value; }
253 constexpr explicit operator const value_type&&()
const&&
noexcept {
return std::move(m_value); }
256 constexpr explicit operator value_type&&() &&
noexcept {
return std::move(m_value); }
275 return std::move(*
this);
305 return std::move(*
this);
335 requires std::signed_integral<value_type>
349 requires std::signed_integral<value_type>
495 constexpr auto operator+=(
const named_type& rhs) &
noexcept(
noexcept(m_value += rhs.m_value)) ->
named_type&
498 m_value += rhs.m_value;
503 constexpr auto operator+=(named_type&& rhs) &
noexcept(
noexcept(m_value += rhs.m_value)) -> named_type&
504 requires arithmetic<value_type>
506 m_value += rhs.m_value;
511 constexpr auto operator-=(
const named_type& rhs) &
noexcept(
noexcept(m_value -= rhs.m_value)) ->
named_type&
512 requires arithmetic<value_type>
514 m_value -= rhs.m_value;
519 constexpr auto operator-=(named_type&& rhs) &
noexcept(
noexcept(m_value -= rhs.m_value)) ->
named_type&
520 requires arithmetic<value_type>
522 m_value -= rhs.m_value;
527 constexpr auto operator*=(
const named_type& rhs) &
noexcept(
noexcept(m_value *= rhs.m_value)) ->
named_type&
528 requires arithmetic<value_type>
530 m_value *= rhs.m_value;
535 constexpr auto operator*=(named_type&& rhs) &
noexcept(
noexcept(m_value *= rhs.m_value)) ->
named_type&
536 requires arithmetic<value_type>
538 m_value *= rhs.m_value;
543 constexpr auto operator/=(
const named_type& rhs) &
noexcept(
noexcept(m_value /= rhs.m_value)) ->
named_type&
544 requires arithmetic<value_type>
546 m_value /= rhs.m_value;
551 constexpr auto operator/=(named_type&& rhs) &
noexcept(
noexcept(m_value /= rhs.m_value)) ->
named_type&
552 requires arithmetic<value_type>
554 m_value /= rhs.m_value;
559 constexpr auto operator%=(
const named_type& rhs) &
noexcept(
noexcept(m_value %= rhs.m_value)) ->
named_type&
560 requires arithmetic<value_type>
562 m_value %= rhs.m_value;
567 constexpr auto operator%=(named_type&& rhs) &
noexcept(
noexcept(m_value %= rhs.m_value)) ->
named_type&
568 requires arithmetic<value_type>
570 m_value %= rhs.m_value;
587 requires std::unsigned_integral<value_type>
594 requires std::unsigned_integral<value_type>
601 requires std::unsigned_integral<value_type>
608 requires std::unsigned_integral<value_type>
615 requires std::unsigned_integral<value_type>
622 requires std::unsigned_integral<value_type>
629 requires std::unsigned_integral<value_type>
636 requires std::unsigned_integral<value_type>
643 requires std::unsigned_integral<value_type>
650 requires std::unsigned_integral<value_type>
657 requires std::unsigned_integral<value_type>
664 requires std::unsigned_integral<value_type>
671 requires std::unsigned_integral<value_type>
678 requires std::unsigned_integral<value_type>
685 requires std::unsigned_integral<value_type>
692 requires std::unsigned_integral<value_type>
699 requires std::unsigned_integral<value_type>
706 requires std::unsigned_integral<value_type>
713 requires std::unsigned_integral<value_type>
720 requires std::unsigned_integral<value_type>
726 constexpr auto operator&=(
const named_type& rhs) &
noexcept(
noexcept(m_value &= rhs.m_value)) ->
named_type&
727 requires std::unsigned_integral<value_type>
729 m_value &= rhs.m_value;
734 constexpr auto operator&=(named_type&& rhs) &
noexcept(
noexcept(m_value &= rhs.m_value)) -> named_type&
735 requires std::unsigned_integral<value_type>
737 m_value &= rhs.m_value;
742 constexpr auto operator|=(
const named_type& rhs) &
noexcept(
noexcept(m_value |= rhs.m_value)) ->
named_type&
743 requires std::unsigned_integral<value_type>
745 m_value |= rhs.m_value;
750 constexpr auto operator|=(named_type&& rhs) &
noexcept(
noexcept(m_value |= rhs.m_value)) ->
named_type&
751 requires std::unsigned_integral<value_type>
753 m_value |= rhs.m_value;
758 constexpr auto operator^=(
const named_type& rhs) &
noexcept(
noexcept(m_value ^= rhs.m_value)) ->
named_type&
759 requires std::unsigned_integral<value_type>
761 m_value ^= rhs.m_value;
766 constexpr auto operator^=(named_type&& rhs) &
noexcept(
noexcept(m_value ^= rhs.m_value)) ->
named_type&
767 requires std::unsigned_integral<value_type>
769 m_value ^= rhs.m_value;
774 constexpr auto operator<<=(
const named_type& rhs) &
noexcept(
noexcept(m_value <<= rhs.m_value)) ->
named_type&
775 requires std::unsigned_integral<value_type>
777 m_value <<= rhs.m_value;
782 constexpr auto operator<<=(named_type&& rhs) &
noexcept(
noexcept(m_value <<= rhs.m_value)) ->
named_type&
783 requires std::unsigned_integral<value_type>
785 m_value <<= rhs.m_value;
790 constexpr auto operator>>=(
const named_type& rhs) &
noexcept(
noexcept(m_value >>= rhs.m_value)) ->
named_type&
791 requires std::unsigned_integral<value_type>
793 m_value >>= rhs.m_value;
798 constexpr auto operator>>=(named_type&& rhs) &
noexcept(
noexcept(m_value >>= rhs.m_value)) ->
named_type&
799 requires std::unsigned_integral<value_type>
801 m_value >>= rhs.m_value;
810 constexpr auto begin() const noexcept(noexcept(
std::ranges::
begin(m_value)))
813 return std::ranges::begin(m_value);
820 return std::ranges::begin(m_value);
824 constexpr auto end() const noexcept(noexcept(
std::ranges::
end(m_value)))
827 return std::ranges::end(m_value);
831 constexpr auto end() noexcept(noexcept(
std::ranges::
end(m_value)))
834 return std::ranges::end(m_value);
843 const named_type& rhs)
noexcept(
noexcept(ostream << rhs.m_value)) -> std::ostream&
846 return ostream << rhs.m_value;
851 named_type& rhs)
noexcept(
noexcept(istream >> rhs.m_value)) -> std::istream&
854 return istream >> rhs.m_value;
863constexpr auto make_named_type(Args&&... args)
noexcept(std::is_nothrow_constructible_v<T, Args...>)
864 requires std::constructible_from<std::remove_cvref_t<T>, Args...>
866 return named_type<std::remove_cvref_t<T>, Name>{std::forward<Args>(args)...};
871constexpr auto make_named_type(std::initializer_list<U> ilist, Args&&... args)
noexcept(
872 std::is_nothrow_constructible_v<T, std::initializer_list<U>&, Args...>)
873 requires std::constructible_from<T, std::initializer_list<U>&, Args...>
875 return named_type<std::remove_cvref_t<T>, Name>{ilist, std::forward<Args>(args)...};
879template <basic_inplace_
string Name,
typename T>
881 std::is_nothrow_constructible_v<named_type<std::remove_cvref_t<T>, Name>, T>)
882 requires std::constructible_from<std::remove_cvref_t<T>, T>
892template <::gw::hashable T, ::gw::basic_inplace_
string Name>
896 [[nodiscard]]
auto inline operator()(const ::gw::named_type<T, Name>& named_type)
const noexcept ->
size_t {
897 using value_type = std::remove_cvref_t<T>;
898 using name_type = std::remove_cvref_t<
decltype(Name)>;
899 auto value_hash = hash<value_type>{}(named_type.value());
900 auto name_hash = hash<name_type>{}(named_type.name());
901 return value_hash ^ name_hash;
906template <
typename T, ::gw::basic_inplace_
string Name,
class CharT>
912 template <
class ParseContext>
913 constexpr auto parse(ParseContext& context) -> ParseContext::iterator {
914 auto it = context.
begin();
915 if (it == context.end()) {
924 if (it != context.end() && *it !=
'}') {
925 throw std::format_error(
"Invalid format args for gw::named_type.");
932 template <
class FormatContext>
933 auto format(const ::gw::named_type<T, Name>& named_type, FormatContext& context)
const -> FormatContext::iterator
934#if __cplusplus > 202002L
935 requires std::formattable<T, CharT>
939 return format_to(context.out(),
"{}: {}", named_type.name(), named_type.value());
942 return format_to(context.out(),
"{}", named_type.value());
Named type wrapper.
Definition named_type.hpp:47
constexpr auto operator+() &&noexcept(noexcept(+m_value)) -> named_type
affirms the contained value
Definition named_type.hpp:334
constexpr auto operator&(const named_type &rhs) const &noexcept(noexcept(m_value &rhs.m_value)) -> named_type
performs binary AND on the contained values
Definition named_type.hpp:586
constexpr auto operator&(const named_type &rhs) &&noexcept(noexcept(m_value &rhs.m_value)) -> named_type
performs binary AND on the contained values
Definition named_type.hpp:600
constexpr auto operator^(named_type &&rhs) const &noexcept(noexcept(m_value ^ rhs.m_value)) -> named_type
performs binary XOR on the contained values
Definition named_type.hpp:649
constexpr named_type(Args &&... args) noexcept(std::is_nothrow_constructible_v< value_type, Args... >)
Construct the gw::named_type object.
Definition named_type.hpp:65
constexpr auto operator|(const named_type &rhs) &&noexcept(noexcept(m_value|rhs.m_value)) -> named_type
performs binary OR on the contained values
Definition named_type.hpp:628
constexpr auto value() const &noexcept -> const_reference
Return the contained value.
Definition named_type.hpp:113
constexpr auto operator>>(const named_type &rhs) const &noexcept(noexcept(m_value > > rhs.m_value)) -> named_type
performs binary right shift on the contained values
Definition named_type.hpp:698
T value_type
The type of the contained value.
Definition named_type.hpp:53
constexpr auto value() &noexcept -> reference
Return the contained value.
Definition named_type.hpp:116
constexpr auto operator+() const &noexcept(noexcept(+m_value)) -> named_type
affirms the contained value
Definition named_type.hpp:327
constexpr auto end() noexcept(noexcept(std::ranges::end(m_value)))
returns an iterator to the end of the contained value
Definition named_type.hpp:831
constexpr auto operator>>(const named_type &rhs) &&noexcept(noexcept(m_value > > rhs.m_value)) -> named_type
performs binary right shift on the contained values
Definition named_type.hpp:712
constexpr auto operator-() &&noexcept(noexcept(-m_value)) -> named_type
negates the contained value
Definition named_type.hpp:348
constexpr auto operator++(int) &&noexcept(noexcept(m_value++)) -> named_type
increments the contained value
Definition named_type.hpp:286
value_type & reference
The type of the reference to the contained value.
Definition named_type.hpp:54
const value_type * const_pointer
The type of the const pointer to the contained value.
Definition named_type.hpp:57
constexpr auto operator-(named_type &&rhs) &&noexcept(noexcept(m_value - rhs.m_value)) -> named_type
subtracts the contained values
Definition named_type.hpp:404
constexpr auto operator/(named_type &&rhs) const &noexcept(noexcept(m_value/rhs.m_value)) -> named_type
devides the contained values
Definition named_type.hpp:446
constexpr auto operator*() &&noexcept -> value_type &&
Access the contained value.
Definition named_type.hpp:110
constexpr auto operator>>(named_type &&rhs) &&noexcept(noexcept(m_value > > rhs.m_value)) -> named_type
performs binary right shift on the contained values
Definition named_type.hpp:719
constexpr auto operator--(int) &&noexcept(noexcept(m_value--)) -> named_type
decrements the contained value
Definition named_type.hpp:316
constexpr auto operator^(named_type &&rhs) &&noexcept(noexcept(m_value ^ rhs.m_value)) -> named_type
performs binary XOR on the contained values
Definition named_type.hpp:663
constexpr auto operator+(const named_type &rhs) &&noexcept(noexcept(m_value+rhs.m_value)) -> named_type
adds the contained values
Definition named_type.hpp:369
constexpr auto operator|(const named_type &rhs) const &noexcept(noexcept(m_value|rhs.m_value)) -> named_type
performs binary OR on the contained values
Definition named_type.hpp:614
constexpr auto operator<<(named_type &&rhs) &&noexcept(noexcept(m_value<< rhs.m_value)) -> named_type
performs binary left shift on the contained values
Definition named_type.hpp:691
constexpr auto operator|(named_type &&rhs) &&noexcept(noexcept(m_value|rhs.m_value)) -> named_type
performs binary OR on the contained values
Definition named_type.hpp:635
constexpr auto operator--(int) &noexcept(noexcept(m_value--)) -> named_type
decrements the contained value
Definition named_type.hpp:309
constexpr auto operator++() &&noexcept(noexcept(++m_value)) -> named_type &&
increments the contained value
Definition named_type.hpp:271
constexpr auto operator*() const &&noexcept -> const value_type &&
Access the contained value.
Definition named_type.hpp:107
constexpr auto operator++() &noexcept(noexcept(++m_value)) -> named_type &
increments the contained value
Definition named_type.hpp:263
constexpr auto operator/(const named_type &rhs) const &noexcept(noexcept(m_value/rhs.m_value)) -> named_type
devides the contained values
Definition named_type.hpp:439
constexpr auto operator+(named_type &&rhs) const &noexcept(noexcept(m_value+rhs.m_value)) -> named_type
adds the contained values
Definition named_type.hpp:362
constexpr auto operator*(const named_type &rhs) const &noexcept(noexcept(m_value *rhs.m_value)) -> named_type
multiplies the contained values
Definition named_type.hpp:411
constexpr auto operator&(named_type &&rhs) &&noexcept(noexcept(m_value &rhs.m_value)) -> named_type
performs binary AND on the contained values
Definition named_type.hpp:607
static constexpr auto name() noexcept
Return the name of the gw::named_type.
Definition named_type.hpp:88
constexpr auto operator<<(const named_type &rhs) &&noexcept(noexcept(m_value<< rhs.m_value)) -> named_type
performs binary left shift on the contained values
Definition named_type.hpp:684
constexpr auto operator--() &&noexcept(noexcept(--m_value)) -> named_type &&
decrements the contained value
Definition named_type.hpp:301
constexpr auto operator<(const named_type &rhs) const &noexcept(noexcept(m_value< rhs.m_value)) -> bool
Compare gw::named_type objects.
Definition named_type.hpp:207
constexpr auto operator*() &noexcept -> reference
Access the contained value.
Definition named_type.hpp:104
constexpr auto operator-(const named_type &rhs) &&noexcept(noexcept(m_value - rhs.m_value)) -> named_type
subtracts the contained values
Definition named_type.hpp:397
constexpr auto transform(F &&func) const &noexcept(noexcept(func(m_value))) -> named_type
Return a gw::named_type containing the transformed contained value.
Definition named_type.hpp:130
constexpr auto operator<<(named_type &&rhs) const &noexcept(noexcept(m_value<< rhs.m_value)) -> named_type
performs binary left shift on the contained values
Definition named_type.hpp:677
constexpr auto operator|(named_type &&rhs) const &noexcept(noexcept(m_value|rhs.m_value)) -> named_type
performs binary OR on the contained values
Definition named_type.hpp:621
value_type * pointer
The type of the pointer to the contained value.
Definition named_type.hpp:56
friend auto operator>>(std::istream &istream, named_type &rhs) noexcept(noexcept(istream > > rhs.m_value)) -> std::istream &
extracts formatted data
Definition named_type.hpp:850
constexpr auto operator-(const named_type &rhs) const &noexcept(noexcept(m_value - rhs.m_value)) -> named_type
subtracts the contained values
Definition named_type.hpp:383
constexpr void swap(named_type &rhs) noexcept(std::is_nothrow_swappable_v< value_type >)
Specialize the std::swap algorithm.
Definition named_type.hpp:165
constexpr auto operator/(const named_type &rhs) &&noexcept(noexcept(m_value/rhs.m_value)) -> named_type
devides the contained values
Definition named_type.hpp:453
constexpr auto operator/(named_type &&rhs) &&noexcept(noexcept(m_value/rhs.m_value)) -> named_type
devides the contained values
Definition named_type.hpp:460
constexpr auto operator*() const &noexcept -> const_reference
Access the contained value.
Definition named_type.hpp:101
constexpr auto operator%(const named_type &rhs) &&noexcept(noexcept(m_value % rhs.m_value)) -> named_type
calculates the remainder of the contained values
Definition named_type.hpp:481
constexpr auto operator*(named_type &&rhs) &&noexcept(noexcept(m_value *rhs.m_value)) -> named_type
multiplies the contained values
Definition named_type.hpp:432
constexpr auto end() const noexcept(noexcept(std::ranges::end(m_value)))
returns an iterator to the end of the contained value
Definition named_type.hpp:824
constexpr named_type(std::initializer_list< U > ilist, Args &&... args) noexcept(std::is_nothrow_constructible_v< value_type, std::initializer_list< U > &, Args... >)
Construct the gw::named_type object.
Definition named_type.hpp:71
constexpr auto operator%(const named_type &rhs) const &noexcept(noexcept(m_value % rhs.m_value)) -> named_type
calculates the remainder of the contained values
Definition named_type.hpp:467
constexpr auto operator--() &noexcept(noexcept(--m_value)) -> named_type &
decrements the contained value
Definition named_type.hpp:293
constexpr auto operator%(named_type &&rhs) &&noexcept(noexcept(m_value % rhs.m_value)) -> named_type
calculates the remainder of the contained values
Definition named_type.hpp:488
constexpr auto operator^(const named_type &rhs) &&noexcept(noexcept(m_value ^ rhs.m_value)) -> named_type
performs binary XOR on the contained values
Definition named_type.hpp:656
constexpr auto begin() noexcept(noexcept(std::ranges::begin(m_value)))
returns an iterator to the beginning of the contained value
Definition named_type.hpp:817
constexpr auto operator<<(const named_type &rhs) const &noexcept(noexcept(m_value<< rhs.m_value)) -> named_type
performs binary left shift on the contained values
Definition named_type.hpp:670
~named_type() noexcept(std::is_nothrow_destructible_v< value_type >)=default
Destroy the contained value.
const value_type & const_reference
The type of the const reference to the contained value.
Definition named_type.hpp:55
friend auto operator<<(std::ostream &ostream, const named_type &rhs) noexcept(noexcept(ostream<< rhs.m_value)) -> std::ostream &
inserts formatted data
Definition named_type.hpp:842
constexpr auto value() &&noexcept -> value_type &&
Return the contained value.
Definition named_type.hpp:122
constexpr auto operator->() noexcept -> pointer
Access the contained value.
Definition named_type.hpp:98
constexpr auto operator+(named_type &&rhs) &&noexcept(noexcept(m_value+rhs.m_value)) -> named_type
adds the contained values
Definition named_type.hpp:376
constexpr auto operator>(const named_type &rhs) const &noexcept(noexcept(m_value > rhs.m_value)) -> bool
Compare gw::named_type objects.
Definition named_type.hpp:214
constexpr auto operator%(named_type &&rhs) const &noexcept(noexcept(m_value % rhs.m_value)) -> named_type
calculates the remainder of the contained values
Definition named_type.hpp:474
constexpr void reset() noexcept(std::is_nothrow_default_constructible_v< value_type >)
Destroy any contained value.
Definition named_type.hpp:173
constexpr auto operator+(const named_type &rhs) const &noexcept(noexcept(m_value+rhs.m_value)) -> named_type
adds the contained values
Definition named_type.hpp:355
constexpr auto operator==(const named_type &rhs) const &noexcept(noexcept(m_value==rhs.m_value)) -> bool
Compare gw::named_type objects.
Definition named_type.hpp:193
constexpr auto operator>>(named_type &&rhs) const &noexcept(noexcept(m_value > > rhs.m_value)) -> named_type
performs binary right shift on the contained values
Definition named_type.hpp:705
constexpr auto begin() const noexcept(noexcept(std::ranges::begin(m_value)))
returns an iterator to the beginning of the contained value
Definition named_type.hpp:810
constexpr auto transform(F &&func) const &&noexcept(noexcept(func(m_value))) -> named_type
Return a gw::named_type containing the transformed contained value.
Definition named_type.hpp:146
constexpr auto transform(F &&func) &&noexcept(noexcept(func(m_value))) -> named_type
Return a gw::named_type containing the transformed contained value.
Definition named_type.hpp:154
constexpr auto operator~() const &noexcept(noexcept(~m_value)) -> named_type
inverts the contained value
Definition named_type.hpp:579
constexpr auto operator++(int) &noexcept(noexcept(m_value++)) -> named_type
increments the contained value
Definition named_type.hpp:279
constexpr auto operator->() const noexcept -> const_pointer
Access the contained value.
Definition named_type.hpp:95
constexpr auto operator&(named_type &&rhs) const &noexcept(noexcept(m_value &rhs.m_value)) -> named_type
performs binary AND on the contained values
Definition named_type.hpp:593
constexpr auto operator*(const named_type &rhs) &&noexcept(noexcept(m_value *rhs.m_value)) -> named_type
multiplies the contained values
Definition named_type.hpp:425
constexpr auto operator*(named_type &&rhs) const &noexcept(noexcept(m_value *rhs.m_value)) -> named_type
multiplies the contained values
Definition named_type.hpp:418
constexpr auto value() const &&noexcept -> const value_type &&
Return the contained value.
Definition named_type.hpp:119
constexpr auto operator^(const named_type &rhs) const &noexcept(noexcept(m_value ^ rhs.m_value)) -> named_type
performs binary XOR on the contained values
Definition named_type.hpp:642
constexpr auto emplace(Args &&... args) noexcept(std::is_nothrow_constructible_v< value_type, Args... >) -> reference
Construct the contained value in-place.
Definition named_type.hpp:181
constexpr auto operator-() const &noexcept(noexcept(-m_value)) -> named_type
negates the contained value
Definition named_type.hpp:341
constexpr auto operator-(named_type &&rhs) const &noexcept(noexcept(m_value - rhs.m_value)) -> named_type
subtracts the contained values
Definition named_type.hpp:390
constexpr auto transform(F &&func) &noexcept(noexcept(func(m_value))) -> named_type
Return a gw::named_type containing the transformed contained value.
Definition named_type.hpp:138
Concept for arithmetic types.
Definition concepts.hpp:18
Concept for decrementable types.
Definition concepts.hpp:29
Concept for incrementable types.
Definition concepts.hpp:22
Concept for istreamable types.
Definition concepts.hpp:52
Concept for ostreamable types.
Definition concepts.hpp:46
GW namespace.
Definition concepts.hpp:14
basic_inplace_string(const CharT(&)[N]) -> basic_inplace_string< N - 1U, CharT >
Deduction guide for basic_inplace_string.
constexpr auto make_named_type(Args &&... args) noexcept(std::is_nothrow_constructible_v< T, Args... >)
Create a gw::named_type object.
Definition named_type.hpp:863