Artifact b7d69e6b1ef14eaccc5504d54571ce2f337d6852:

Wiki page [Features/IntegratedTypeTraits] by luismachuca 2017-04-06 23:58:31.
D 2017-04-06T23:58:31.194
L Features/IntegratedTypeTraits
P 91ceca280e89317d0a055ab2e944a45d1da8896a
U luismachuca
W 2397
The <i>cxxomfort</i> library adds among its [Features] a set of [Features/TypeTraits|C++11 traits] and helper utilities to its public interface. However, for its own use, it also adds a <u>subset of the <code><type_traits></code> interface</u> used to remove dependencies on compiler-specific or third-party Tr1 implementations where those might not be available (eg.: some <em>Express</em> versions of Visual C++).

In case they are required by client code (for example: to implement a backport of <code><type_traits></code> in a compiler that doesn't have it available) these traits are included in header <code>cxxomfort/util/type_traits.hpp</code> and defined under namespace <code>cxxomfort::traits</code>. They are <b><i>not</i></b> mapped to namespace std.

The traits defined are, for the most part, those that do not require compiler-specific intrinsics and those that deal with pointer and reference transformations. 

List of <code>type_traits</code> defined by this library:

  *  <code>is_void</code>, <code>is_integral</code>, <code>is_floating_point</code>, <code>is_arithmetic</code>, <code>is_fundamental</code>, used to identify C++'s native types and their behaviours.
  *  <code><nowiki>is_[const|volatile]</nowiki></code> used for CV-awareness.
  *  <code><nowiki>[add|remove]_const</nowiki></code>, <code><nowiki>[add|remove]_volatile</nowiki></code>, <code><nowiki>[add|remove]_cv</nowiki></code>, used for CV-awareness.
  *  <code>is_pointer</code>, <code>is_reference</code>.
  *  <code><nowiki>[add|remove]_pointer</nowiki></code>, <code><nowiki>[add|remove]_reference</nowiki></code>.
  *  <code>is_signed</code>, <code>is_unsigned</code>.
  *  <code>make_signed</code>, <code>make_unsigned</code>.
  *  <code>is_array</code>, <code>rank</code>, <code>extent</code>, <code>remove_extent</code>, used for metaprogramming behaviour of array types.
  *  <code>is_same</code>.
  *  <code>is_function</code> (for function signatures w/up to 5 arguments).
  *  <code>is_empty</code> (note: this is an approximation; does not use compiler intrinsics usually available).
  *  <code>is_enum</code>, <code>is_union</code> (note: these require compiler intrinsics support such as <code>__is_enum</code>).


<hr/>

See also:

  *  [Features/MetaprogrammingHelpers] (for enable_if, etc)
  *  [Features/OtherLibraryUtilities]
  *  Back to [Features].



Z e0cdcfce5d304e93a95087482923bd4a