Trait with type Base
, plus the constantness as in Key
.
More...
#include <MetaUtils.h>
Additional Inherited Members | |
Public Types inherited from util::details::with_const_as_impl< Base, std::remove_reference_t< Key > > | |
using | type = std::remove_const_t< Base > |
Trait with type Base
, plus the constantness as in Key
.
Base | the basic type being returned |
Key | a type expressing the constantness wanted for Base |
The type
member of this trait is:
Base
with constantness removed, if Key
is non-constant typeBase
with constantness added, if Key
is a constant typeThis trait passes through references. Both Base
and Key
are treated as they were no references (e.g. a int const&
is treated as a int const
). The referenceness of the type in the trait is the same as the one of Base
.
Therefore, for example:
with_const_as<int const, double>
yields int
;with_const_as<int const, double const>
yields int const
;with_const_as<int const&, double>
yields int&
;with_const_as<int, double const&>
yields int const
.R-value references are likewise taken into account.
Definition at line 540 of file MetaUtils.h.