4.6.0
Freundlich's C++ toolkit
Loading...
Searching...
No Matches
fcppt.ref

Description

Reference wrappers for incomplete types.

Classes

struct  fcppt::is_reference< Type >
 Tests if a type is an fcppt::reference. More...
 
class  fcppt::reference< Type >
 A simple reference wrapper that supports incomplete types. More...
 
struct  fcppt::reference_hash< fcppt::reference< Type > >
 A hash for fcppt::reference that hashes pointers. More...
 

Functions

template<typename Type >
fcppt::reference< Type const > fcppt::make_cref (Type const &_ref) noexcept
 Convenience function to create const references.
 
template<typename Type >
fcppt::reference< Type > fcppt::make_ref (Type &_ref) noexcept
 Convenience function to create references.
 
template<typename T >
bool fcppt::operator== (fcppt::reference< T > const &_a, fcppt::reference< T > const &_b) noexcept
 Compares two references for equality.
 
template<typename T >
bool fcppt::operator!= (fcppt::reference< T > const &_a, fcppt::reference< T > const &_b) noexcept
 Compares two references for inequality.
 
template<typename T >
bool fcppt::operator< (fcppt::reference< T > const &_a, fcppt::reference< T > const &_b) noexcept
 Compares two references lexicographically.
 
template<typename T , typename Ch , typename Traits >
std::basic_ostream< Ch, Traits > & fcppt::operator<< (std::basic_ostream< Ch, Traits > &_stream, fcppt::reference< T > const &_ref)
 Outputs a reference wrapper to a stream.
 
template<typename Base , typename Type >
fcppt::reference< Base > fcppt::reference_to_base (fcppt::reference< Type > const _ref) noexcept
 Converts a reference to a base class.
 
template<typename Type >
fcppt::reference< Type const > fcppt::reference_to_const (fcppt::reference< Type > const _ref) noexcept
 Converts a reference to a const reference.
 

Function Documentation

◆ make_cref()

template<typename Type >
fcppt::reference< Type const > fcppt::make_cref ( Type const & _ref)
inlinenoexcept

Convenience function to create const references.

◆ make_ref()

template<typename Type >
fcppt::reference< Type > fcppt::make_ref ( Type & _ref)
inlinenoexcept

Convenience function to create references.

◆ operator!=()

template<typename T >
bool fcppt::operator!= ( fcppt::reference< T > const & _a,
fcppt::reference< T > const & _b )
noexcept

Compares two references for inequality.

Compares _a and _b for inequality. Equal to !(_a == _b).

Parameters
_aThe first reference
_bThe second reference

◆ operator<()

template<typename T >
bool fcppt::operator< ( fcppt::reference< T > const & _a,
fcppt::reference< T > const & _b )
noexcept

Compares two references lexicographically.

Compares _a and _b lexicographically by comparing the stored pointers via std::less.

Parameters
_aThe first reference
_bThe second reference

◆ operator<<()

template<typename T , typename Ch , typename Traits >
std::basic_ostream< Ch, Traits > & fcppt::operator<< ( std::basic_ostream< Ch, Traits > & _stream,
fcppt::reference< T > const & _ref )

Outputs a reference wrapper to a stream.

◆ operator==()

template<typename T >
bool fcppt::operator== ( fcppt::reference< T > const & _a,
fcppt::reference< T > const & _b )
noexcept

Compares two references for equality.

Compares _a and _b for equality. Two references are equal if they refer to the same object.

Parameters
_aThe first reference
_bThe second reference

◆ reference_to_base()

template<typename Base , typename Type >
fcppt::reference< Base > fcppt::reference_to_base ( fcppt::reference< Type > const _ref)
inlinenoexcept

Converts a reference to a base class.

Template Parameters
BaseMust be a base class of Type

◆ reference_to_const()

template<typename Type >
fcppt::reference< Type const > fcppt::reference_to_const ( fcppt::reference< Type > const _ref)
inlinenoexcept

Converts a reference to a const reference.

Template Parameters
TypeMust not be const