Skip to content

Commit

Permalink
✨ add remove_reference trait
Browse files Browse the repository at this point in the history
  • Loading branch information
zie87 committed Oct 13, 2023
1 parent eb69ff2 commit 88d2d5c
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
19 changes: 19 additions & 0 deletions include/zll/meta/traits/remove_reference.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef ZLL_META_TRAITS_REMOVEREFERENCE_HPP
#define ZLL_META_TRAITS_REMOVEREFERENCE_HPP

#include "zll/meta/traits/remove_cv.hpp"

namespace zll {
namespace meta {
// clang-format off
template <typename T> struct remove_reference { typedef T type; };
template <typename T> struct remove_reference<T&> { typedef T type; };
// clang-format on
template <typename T>
struct remove_cvref {
typedef typename zll::meta::remove_cv<typename zll::meta::remove_reference<T>::type>::type type;
};
} // namespace meta
} // namespace zll

#endif // ZLL_META_TRAITS_REMOVEREFERENCE_HPP
3 changes: 3 additions & 0 deletions include/zll/meta/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,18 @@
#include "zll/meta/traits/is_const.hpp"
#include "zll/meta/traits/is_enum.hpp"
#include "zll/meta/traits/is_floating_point.hpp"
#include "zll/meta/traits/is_function.hpp"
#include "zll/meta/traits/is_integral.hpp"
#include "zll/meta/traits/is_member_pointer.hpp"
#include "zll/meta/traits/is_object.hpp"
#include "zll/meta/traits/is_pointer.hpp"
#include "zll/meta/traits/is_reference.hpp"
#include "zll/meta/traits/is_same.hpp"
#include "zll/meta/traits/is_scalar.hpp"
#include "zll/meta/traits/is_union.hpp"

#include "zll/meta/traits/remove_cv.hpp"
#include "zll/meta/traits/remove_reference.hpp"


#endif // ZLL_TYPETRAITS_HPP

0 comments on commit 88d2d5c

Please sign in to comment.