PropagateConst< Wrapped > Class Template Reference

Wrapper for a pointer to propagate const to the pointed to value. More...

#include <ArmarXCore/core/util/PropagateConst.h>

Public Types

using ElementType = typename std::remove_reference< decltype(*std::declval< Wrapped & >())>::type
 

Public Member Functions

ElementTypeget ()
 
const ElementTypeget () const
 
constexpr operator bool () const
 
template<class T = Wrapped, typename std::enable_if< std::is_pointer< T >::value||std::is_convertible< T, const ElementType * >::value, bool >::type = true>
constexpr operator const ElementType * () const
 
template<class T = Wrapped, typename std::enable_if< std::is_pointer< T >::value||std::is_convertible< T, const ElementType * >::value, bool >::type = true>
constexpr operator ElementType * ()
 
ElementTypeoperator* ()
 
const ElementTypeoperator* () const
 
ElementTypeoperator-> ()
 
const ElementTypeoperator-> () const
 
PropagateConstoperator= (PropagateConst &&)=default
 
template<class T , typename std::enable_if< std::is_convertible< T &&, Wrapped >::value, bool >::type = true>
constexpr PropagateConstoperator= (PropagateConst< T > &&p)
 
template<class T , typename std::enable_if< std::is_convertible< T &&, Wrapped >::value &&!meta::TypeTemplateTraits::IsInstanceOf< PropagateConst, typename std::decay< T >::type >::value, bool >::type = true>
constexpr PropagateConstoperator= (T &&p)
 
constexpr PropagateConst ()=default
 
constexpr PropagateConst (PropagateConst &&)=default
 
template<class T , typename std::enable_if< std::is_constructible< Wrapped, T && >::value &&std::is_convertible< T &&, Wrapped >::value, bool >::type = true>
constexpr PropagateConst (PropagateConst< T > &&p)
 
template<class T , typename std::enable_if< std::is_constructible< Wrapped, T && >::value &&!std::is_convertible< T &&, Wrapped >::value, bool >::type = true>
constexpr PropagateConst (PropagateConst< T > &&p)
 
template<class T , typename std::enable_if< std::is_constructible< Wrapped, T && >::value &&std::is_convertible< T &&, Wrapped >::value &&!meta::TypeTemplateTraits::IsInstanceOf< PropagateConst, typename std::decay< T >::type >::value, bool >::type = true>
constexpr PropagateConst (T &&p)
 
template<class T , typename std::enable_if< std::is_constructible< Wrapped, T && >::value &&!std::is_convertible< T &&, Wrapped >::value &&!meta::TypeTemplateTraits::IsInstanceOf< PropagateConst, typename std::decay< T >::type >::value, bool >::type = true>
constexpr PropagateConst (T &&p)
 
constexpr PropagateConst (Wrapped &p)
 
constexpr void swap (PropagateConst &pt) noexcept(noexcept(std::swap(std::declval< Wrapped & >(), std::declval< Wrapped & >())))
 

Friends

template<class wrapped >
constexpr const friend wrapped & GetUnderlying (const PropagateConst< wrapped > &pt) noexcept
 
template<class wrapped >
constexpr friend wrapped & GetUnderlying (PropagateConst< wrapped > &pt) noexcept
 

Detailed Description

template<class Wrapped>
class armarx::PropagateConst< Wrapped >

Wrapper for a pointer to propagate const to the pointed to value.

\url{http://en.cppreference.com/w/cpp/experimental/propagate_const} Only difference: the armarx coding style is used (CamelCase instead of snake case) and some constexpr were deleted to work with gcc4.8

struct T
{
void f() {std::cout<<"non const\n";}
void f() const {std::cout<<" const\n";}
};
T inst;
struct Test
{
T * nc{&inst};
const T * c{&inst};
};
int main()
{
Test t;
t.nc->f(); // non const
t. c->f(); // const
t.pc->f(); // non const
const Test tc;
tc.nc->f();// non const
tc. c->f();// const
tc.pc->f();// const
}

Definition at line 69 of file PropagateConst.h.

Member Typedef Documentation

◆ ElementType

using ElementType = typename std::remove_reference<decltype(*std::declval<Wrapped&>())>::type

Definition at line 89 of file PropagateConst.h.

Constructor & Destructor Documentation

◆ PropagateConst() [1/7]

constexpr PropagateConst ( )
constexprdefault

◆ PropagateConst() [2/7]

constexpr PropagateConst ( PropagateConst< Wrapped > &&  )
constexprdefault

◆ PropagateConst() [3/7]

constexpr PropagateConst ( PropagateConst< T > &&  p)
inlineconstexpr

Definition at line 109 of file PropagateConst.h.

◆ PropagateConst() [4/7]

constexpr PropagateConst ( PropagateConst< T > &&  p)
inlineexplicitconstexpr

Definition at line 118 of file PropagateConst.h.

◆ PropagateConst() [5/7]

constexpr PropagateConst ( T &&  p)
inlineconstexpr

Definition at line 135 of file PropagateConst.h.

◆ PropagateConst() [6/7]

constexpr PropagateConst ( T &&  p)
inlineexplicitconstexpr

Definition at line 146 of file PropagateConst.h.

◆ PropagateConst() [7/7]

constexpr PropagateConst ( Wrapped &  p)
inlineconstexpr

Definition at line 149 of file PropagateConst.h.

Member Function Documentation

◆ get() [1/2]

ElementType* get ( )
inline

Definition at line 192 of file PropagateConst.h.

◆ get() [2/2]

const ElementType* get ( ) const
inline

Definition at line 188 of file PropagateConst.h.

+ Here is the caller graph for this function:

◆ operator bool()

constexpr operator bool ( ) const
inlineexplicitconstexpr

Definition at line 215 of file PropagateConst.h.

◆ operator const ElementType *()

constexpr operator const ElementType * ( ) const
inlineconstexpr

Definition at line 249 of file PropagateConst.h.

◆ operator ElementType *()

constexpr operator ElementType * ( )
inlineconstexpr

Definition at line 262 of file PropagateConst.h.

◆ operator*() [1/2]

ElementType& operator* ( )
inline

Definition at line 225 of file PropagateConst.h.

◆ operator*() [2/2]

const ElementType& operator* ( ) const
inline

Definition at line 221 of file PropagateConst.h.

◆ operator->() [1/2]

ElementType* operator-> ( )
inline

Definition at line 235 of file PropagateConst.h.

◆ operator->() [2/2]

const ElementType* operator-> ( ) const
inline

Definition at line 231 of file PropagateConst.h.

◆ operator=() [1/3]

PropagateConst& operator= ( PropagateConst< Wrapped > &&  )
default

◆ operator=() [2/3]

constexpr PropagateConst& operator= ( PropagateConst< T > &&  p)
inlineconstexpr

Definition at line 159 of file PropagateConst.h.

◆ operator=() [3/3]

constexpr PropagateConst& operator= ( T &&  p)
inlineconstexpr

Definition at line 173 of file PropagateConst.h.

◆ swap()

constexpr void swap ( PropagateConst< Wrapped > &  pt)
inlineconstexprnoexcept

Definition at line 180 of file PropagateConst.h.

+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ GetUnderlying [1/2]

constexpr const friend wrapped& GetUnderlying ( const PropagateConst< wrapped > &  pt)
friend

◆ GetUnderlying [2/2]

constexpr friend wrapped& GetUnderlying ( PropagateConst< wrapped > &  pt)
friend

The documentation for this class was generated from the following file:
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
pc
Introduction Thank you for taking interest in our work and downloading this software This library implements the algorithm described in the paper R R R Klein Efficient RANSAC for Point Cloud Shape in Computer Graphics Blackwell June If you use this software you should cite the aforementioned paper in any resulting publication Please send comments or bug reports to Ruwen Roland BUT NOT LIMITED THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY OR CONSEQUENTIAL WHETHER IN STRICT OR EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE Example usage This section shows how to use the library to detect the shapes in a point cloud PointCloud pc
Definition: ReadMe.txt:68
T
float T
Definition: UnscentedKalmanFilterTest.cpp:35
main
int main(int argc, char *argv[])
Definition: Admin.cpp:45
armarx::PropagateConst
Wrapper for a pointer to propagate const to the pointed to value.
Definition: PropagateConst.h:69