Skip to content

Commit 389654b

Browse files
authored
Create is_reference_wrapper.hpp
1 parent 98eb77a commit 389654b

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

is_reference_wrapper.hpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include <functional>
4+
5+
// A type can specialize this template if it wants itself to be treated like
6+
// a std::reference_wrapper. E.g. a replacement of std::reference_wrapper that
7+
// supports constexpr operations may want to specialize this template.
8+
template <class T>
9+
struct is_reference_wrapper : std::false_type {};
10+
template <class U>
11+
struct is_reference_wrapper<std::reference_wrapper<U>> : std::true_type {};
12+
template <class T>
13+
constexpr bool is_reference_wrapper_v = is_reference_wrapper<T>::value;

0 commit comments

Comments
 (0)