@@ -1789,13 +1789,13 @@ inline constexpr auto as_( auto&& x ) -> decltype(auto)
1789
1789
{
1790
1790
if constexpr (narrowing<C, CPP2_TYPEOF (x)>) {
1791
1791
static_assert (
1792
- program_violates_type_safety_guarantee<C, CPP2_TYPEOF (x)>,
1792
+ program_violates_type_safety_guarantee<C, decltype (x)>,
1793
1793
" 'as' does not allow unsafe narrowing conversions - if you're sure you want this, use `unsafe_narrow<T>()` to force the conversion"
1794
1794
);
1795
1795
}
1796
1796
else if constexpr ( requires { { as<C>(CPP2_FORWARD (x)) } -> std::same_as<nonesuch_>; } ) {
1797
1797
static_assert (
1798
- program_violates_type_safety_guarantee<C, CPP2_TYPEOF (x)>,
1798
+ program_violates_type_safety_guarantee<C, decltype (x)>,
1799
1799
" No safe 'as' cast available - please check your cast"
1800
1800
);
1801
1801
}
@@ -1808,13 +1808,13 @@ inline constexpr auto as_() -> decltype(auto)
1808
1808
{
1809
1809
if constexpr ( !requires { as<C, x>(); }) {
1810
1810
static_assert (
1811
- program_violates_type_safety_guarantee<C, CPP2_TYPEOF (x)>,
1811
+ program_violates_type_safety_guarantee<C, decltype (x)>,
1812
1812
" No safe 'as' cast available - please check your cast"
1813
1813
);
1814
1814
}
1815
1815
if constexpr ( requires { {as<C, x>()} -> std::same_as<nonesuch_>; } ) {
1816
1816
static_assert (
1817
- program_violates_type_safety_guarantee<C, CPP2_TYPEOF (x)>,
1817
+ program_violates_type_safety_guarantee<C, decltype (x)>,
1818
1818
" Literal cannot be narrowed using 'as' - if you're sure you want this, use 'unsafe_narrow<T>()' to force the conversion"
1819
1819
);
1820
1820
}
0 commit comments