dune-common 2.10
Loading...
Searching...
No Matches
Dune::AlignedNumberImpl::AlignedNumber< T, align > Class Template Reference

aligned wrappers for arithmetic types More...

#include <dune/common/debugalign.hh>

Inheritance diagram for Dune::AlignedNumberImpl::AlignedNumber< T, align >:
Inheritance graph

Public Member Functions

 AlignedNumber ()=default
 
 AlignedNumber (T value)
 
template<class U , std::size_t uAlign, class = std::enable_if_t<(align >= uAlign) && std::is_convertible<U, T>::value>>
 AlignedNumber (const AlignedNumber< U, uAlign > &o)
 
template<class U , class = std::enable_if_t<std::is_convertible<T, U>::value>>
 operator U () const
 
const T & value () const
 
T & value ()
 
template<class U = T, class = std::void_t<decltype(++std::declval<U&>())>>
AlignedNumberoperator++ ()
 
template<class U = T, class = std::void_t<decltype(--std::declval<U&>())>>
AlignedNumberoperator-- ()
 
template<class U = T, class = std::void_t<decltype(std::declval<U&>()++)>>
decltype(auto) operator++ (int)
 
template<class U = T, class = std::void_t<decltype(std::declval<U&>()--)>>
decltype(auto) operator-- (int)
 
template<class U = T, class = std::void_t<decltype(+std::declval<const U&>())>>
decltype(auto) operator+ () const
 
template<class U = T, class = std::void_t<decltype(-std::declval<const U&>())>>
decltype(auto) operator- () const
 
template<class U = T, class = std::void_t<decltype(~std::declval<const U&>())>>
decltype(auto) operator~ () const
 
template<class U = T, class = std::void_t<decltype(!std::declval<const U&>())>>
decltype(auto) operator! () const
 
 DUNE_ASSIGN_OP (+=)
 
 DUNE_ASSIGN_OP (-=)
 
DUNE_ASSIGN_OP * DUNE_ASSIGN_OP (/=);DUNE_ASSIGN_OP(%=
 
DUNE_ASSIGN_OP^ DUNE_ASSIGN_OP (&=);DUNE_ASSIGN_OP(|=
 
 DUNE_ASSIGN_OP (<<=)
 
 DUNE_ASSIGN_OP (> >=)
 

Static Public Member Functions

static void * operator new (std::size_t count, void *ptr)
 Overload of placement new.
 
static void * operator new[] (std::size_t count, void *ptr)
 Overload of placement new[].
 

Detailed Description

template<class T, std::size_t align>
class Dune::AlignedNumberImpl::AlignedNumber< T, align >

aligned wrappers for arithmetic types

Constructor & Destructor Documentation

◆ AlignedNumber() [1/3]

template<class T , std::size_t align>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::AlignedNumber ( )
default

◆ AlignedNumber() [2/3]

template<class T , std::size_t align>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::AlignedNumber ( T value)
inline

◆ AlignedNumber() [3/3]

template<class T , std::size_t align>
template<class U , std::size_t uAlign, class = std::enable_if_t<(align >= uAlign) && std::is_convertible<U, T>::value>>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::AlignedNumber ( const AlignedNumber< U, uAlign > & o)
inline

Member Function Documentation

◆ DUNE_ASSIGN_OP() [1/6]

template<class T , std::size_t align>
DUNE_ASSIGN_OP^ Dune::AlignedNumberImpl::AlignedNumber< T, align >::DUNE_ASSIGN_OP ( & )

◆ DUNE_ASSIGN_OP() [2/6]

template<class T , std::size_t align>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::DUNE_ASSIGN_OP ( + )

◆ DUNE_ASSIGN_OP() [3/6]

template<class T , std::size_t align>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::DUNE_ASSIGN_OP ( - )

◆ DUNE_ASSIGN_OP() [4/6]

template<class T , std::size_t align>
DUNE_ASSIGN_OP * Dune::AlignedNumberImpl::AlignedNumber< T, align >::DUNE_ASSIGN_OP ( / )

◆ DUNE_ASSIGN_OP() [5/6]

template<class T , std::size_t align>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::DUNE_ASSIGN_OP ( << )

◆ DUNE_ASSIGN_OP() [6/6]

template<class T , std::size_t align>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::DUNE_ASSIGN_OP ( >= )

◆ operator new()

static void * Dune::AlignedBase< align, AlignedNumber< T, align > >::operator new ( std::size_t count,
void * ptr )
inlinestaticinherited

Overload of placement new.

Checks if address is misaligned and forwards to global new

Parameters
countnumber of elements to allocate
ptraddress of the placement new
Returns
void* the address where the object is placed

◆ operator new[]()

static void * Dune::AlignedBase< align, AlignedNumber< T, align > >::operator new[] ( std::size_t count,
void * ptr )
inlinestaticinherited

Overload of placement new[].

Checks if address is misaligned and forwards to global new

Parameters
countnumber of elements to allocate
ptraddress of the placement new
Returns
void* the address where the object is placed

◆ operator U()

template<class T , std::size_t align>
template<class U , class = std::enable_if_t<std::is_convertible<T, U>::value>>
Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator U ( ) const
inlineexplicit

◆ operator!()

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(!std::declval<const U&>())>>
decltype(auto) Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator! ( ) const
inline

◆ operator+()

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(+std::declval<const U&>())>>
decltype(auto) Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator+ ( ) const
inline

◆ operator++() [1/2]

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(++std::declval<U&>())>>
AlignedNumber & Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator++ ( )
inline

◆ operator++() [2/2]

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(std::declval<U&>()++)>>
decltype(auto) Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator++ ( int )
inline

◆ operator-()

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(-std::declval<const U&>())>>
decltype(auto) Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator- ( ) const
inline

◆ operator--() [1/2]

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(--std::declval<U&>())>>
AlignedNumber & Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator-- ( )
inline

◆ operator--() [2/2]

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(std::declval<U&>()--)>>
decltype(auto) Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator-- ( int )
inline

◆ operator~()

template<class T , std::size_t align>
template<class U = T, class = std::void_t<decltype(~std::declval<const U&>())>>
decltype(auto) Dune::AlignedNumberImpl::AlignedNumber< T, align >::operator~ ( ) const
inline

◆ value() [1/2]

template<class T , std::size_t align>
T & Dune::AlignedNumberImpl::AlignedNumber< T, align >::value ( )
inline

◆ value() [2/2]

template<class T , std::size_t align>
const T & Dune::AlignedNumberImpl::AlignedNumber< T, align >::value ( ) const
inline

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