SRD parser - Access value as a RW reference

This commit is contained in:
Emmanuel BENOîT 2017-11-17 15:44:49 +01:00
parent 1ce16d63cb
commit 5db261909a
2 changed files with 26 additions and 6 deletions
include/ebcl

View file

@ -72,11 +72,12 @@ public:
void handleFlushToken( bool handleIt ) noexcept;
bool handleFlushToken( ) const noexcept;
template< typename T >
T const& getData( ) const;
template< typename T > T const& getData( ) const;
template< typename T > T& getData( );
private:
T_Variant const& getExecStackTop( ) const;
T_Variant const& getExecStackTop( ) const noexcept;
T_Variant& getExecStackTop( ) noexcept;
};
M_CLASS_POINTERS( SRDParser );
@ -87,6 +88,12 @@ inline T const& T_SRDParser::getData( ) const
return getExecStackTop( ).value< T >( );
}
template< typename T >
inline T& T_SRDParser::getData( )
{
return getExecStackTop( ).value< T >( );
}
} // namespace
#endif // _H_EBCL_SRDPARSER