Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview

Artifact ID: b7d69e6b1ef14eaccc5504d54571ce2f337d6852
Page Name:Features/IntegratedTypeTraits
Date: 2017-04-06 23:58:31
Original User: luismachuca
Parent: 91ceca280e89317d0a055ab2e944a45d1da8896a (diff)
Content

The cxxomfort library adds among its Features a set of C++11 traits and helper utilities to its public interface. However, for its own use, it also adds a subset of the <type_traits> interface used to remove dependencies on compiler-specific or third-party Tr1 implementations where those might not be available (eg.: some Express versions of Visual C++).

In case they are required by client code (for example: to implement a backport of <type_traits> in a compiler that doesn't have it available) these traits are included in header cxxomfort/util/type_traits.hpp and defined under namespace cxxomfort::traits. They are not 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 type_traits defined by this library:

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

See also: