xtd 0.2.0
Loading...
Searching...
No Matches
as_const.hpp
Go to the documentation of this file.
1
3#pragma once
4#include <type_traits>
5
7namespace xtd {
12 template<class type_t>
13 constexpr std::add_const_t<type_t>& as_const(type_t& type) noexcept {
14 return type;
15 }
16
20 template<class type_t>
21 constexpr std::add_const_t<type_t>* as_const(type_t* type) noexcept {
22 return type;
23 }
24
25 template<class type_t>
26 void as_const(const type_t&&) = delete;
28}
std::type_info type
Stores information about a type.
Definition type.hpp:23
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
constexpr std::add_const_t< type_t > & as_const(type_t &type) noexcept
Obtains a reference to const to its argument.
Definition as_const.hpp:13