Skip to content

Commit b59a714

Browse files
committed
add remove_cvref_t to is_struct & is_proto_struct
1 parent bba93ff commit b59a714

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

include/noarr/structures/base/structs_common.hpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ constexpr auto pass_pack(pack<Structs...> s, to_each<Arg> p, std::index_sequence
123123
* @tparam T: the input type
124124
*/
125125
template<class T>
126-
using is_struct = helpers::is_struct_impl<T>;
126+
using is_struct = helpers::is_struct_impl<std::remove_cvref_t<T>>;
127127

128128
template<class T>
129129
static constexpr auto is_struct_v = is_struct<T>::value;
@@ -137,14 +137,17 @@ concept IsStruct = is_struct_v<T>;
137137
* @tparam T: the input type
138138
*/
139139
template<class T>
140-
using is_proto_struct = helpers::is_proto_struct_impl<T>;
140+
using is_proto_struct = helpers::is_proto_struct_impl<std::remove_cvref_t<T>>;
141141

142142
template<class T>
143143
static constexpr auto is_proto_struct_v = is_proto_struct<T>::value;
144144

145145
template<class T>
146146
concept IsProtoStruct = is_proto_struct_v<T>;
147147

148+
template<class T>
149+
concept IsStructOrProtoStruct = IsStruct<T> || IsProtoStruct<T>;
150+
148151
template<bool PreservesLayout = false, class F>
149152
constexpr auto make_proto(F f) noexcept {
150153
return helpers::make_proto_impl<F, PreservesLayout>(f);

0 commit comments

Comments
 (0)