LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::with_const_as< Base, Key > Struct Template Reference

Trait with type Base, plus the constantness as in Key. More...

#include "MetaUtils.h"

Inheritance diagram for util::with_const_as< Base, Key >:
util::details::with_const_as_dispatcher< Base, Key > util::details::with_const_as_dispatch_keyref< Base, Key > util::details::with_const_as_dispatch_ref< Base, std::remove_reference_t< Key > > util::details::with_const_as_impl< Base, std::remove_reference_t< Key > >

Public Types

using type = std::remove_const_t< Base >
 

Detailed Description

template<typename Base, typename Key>
struct util::with_const_as< Base, Key >

Trait with type Base, plus the constantness as in Key.

Template Parameters
Basethe basic type being returned
Keya type expressing the constantness wanted for Base

The type member of this trait is:

  • the type Base with constantness removed, if Key is non-constant type
  • the type Base with constantness added, if Key is a constant type

This 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:

R-value references are likewise taken into account.

Definition at line 506 of file MetaUtils.h.

Member Typedef Documentation

using util::details::with_const_as_impl< Base, typename, typename >::type = std::remove_const_t<Base>
inherited

Definition at line 726 of file MetaUtils.h.


The documentation for this struct was generated from the following file: