Into

Modules

Documentation

classPii::ToReference

#include <PiiTypeTraits.h>

A static functor that converts pointers to references and keeps references as such.

Description

 int i = 1, j;
 // Both of these set j to 1
 j = ToReference<int>::apply(i);
 j = ToReference<int*>::apply(&i);

The Type member of this class evaluates to the non-pointer type. That is, ToReference<T>::Type is T&, and so is ToReference<T*>::Type.

Public types

typedef T &

Static public member functions

static T &
(
  • T & value
)

Function details

  • static T & apply

    (
    • T & value
    )
    [inline, static]
Notes (0)

Add a note

Not a single note added yet. Be the first, add yours.