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 [[nodiscard]] constexpr auto as_const(type_t& type) noexcept -> std::add_const_t<type_t>& {
14 return type;
15 }
16
20 template<class type_t>
21 [[nodiscard]] constexpr auto as_const(type_t* type) noexcept -> std::add_const_t<type_t>* {
22 return type;
23 }
24
25 template<class type_t>
26 auto as_const(const type_t&&) -> void = 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 auto as_const(type_t &type) noexcept -> std::add_const_t< type_t > &
Obtains a reference to const to its argument.
Definition as_const.hpp:13