DefaultLValue< VALUETYPE > Class Template Reference

#include <apibase.h>

Detailed Description

template<typename VALUETYPE>
class maxon::DefaultLValue< VALUETYPE >

Use this class when you need a default argument for parameters of type VALUETYPE&. As an example, consider a function which can return connection details only if required by caller.

Result<Bool> IsConnected(const GraphNode& n, GraphConnection& conn = DefaultLValue<GraphConnection>());
const Py_UNICODE size_t n
Definition: unicodeobject.h:1184
Tuple< GraphNode, Wires > GraphConnection
Definition: graph.h:431

Public Member Functions

 DefaultLValue ()=default
 
 DefaultLValue (const VALUETYPE &value)
 
 operator VALUETYPE & ()
 
 operator const VALUETYPE & () const
 

Private Attributes

VALUETYPE _value
 

Constructor & Destructor Documentation

◆ DefaultLValue() [1/2]

DefaultLValue ( )
default

◆ DefaultLValue() [2/2]

DefaultLValue ( const VALUETYPE &  value)
explicit

Member Function Documentation

◆ operator VALUETYPE &()

operator VALUETYPE & ( )

◆ operator const VALUETYPE &()

operator const VALUETYPE & ( ) const

Member Data Documentation

◆ _value

VALUETYPE _value
private