-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathref.hpp
More file actions
32 lines (23 loc) · 811 Bytes
/
Copy pathref.hpp
File metadata and controls
32 lines (23 loc) · 811 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/* File: /lib/ref.hpp
*
* This file is a part of cpplib project which is distributed under MIT License.
* See file LICENSE for full license details.
*
* Copyright (c) 2020-present Nikita Zuev (V.Slavski!) <[email protected]>
*/
#ifndef CPPLIB__lib__ref__hpp
#define CPPLIB__lib__ref__hpp
#include <functional>
namespace lib {
// DECLARATION lib::Ref, lib::RefC
template< class T > using Ref = ::std::reference_wrapper< T >;
template< class T > using RefC = ::std::reference_wrapper< const T >;
// DECLARATION lib::MkRef, lib::MkRefC
template< class T >
inline constexpr auto MkRef( T & ref ) noexcept
{ return ::std::ref<T>( ref ); }
template< class T >
inline constexpr auto MkRefC( const T & ref ) noexcept
{ return ::std::cref<T>( ref ); }
} // namespace lib
#endif // CPPLIB__lib__ref__hpp