Skip to content
Snippets Groups Projects

procedural aql

Merged Jan Trávníček requested to merge merge-jt into master
2 files
+ 14
21
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -114,7 +114,10 @@ public:
template < class Type >
class ValueHolder : public ValueHolderImpl < Type > {
public:
ValueHolder ( Type && value, bool temporary ) : ValueHolderImpl < Type > ( ParamQualifiers::paramQualifiers < Type > ( ), temporary ) {
ValueHolder ( Type && value, bool temporary ) : ValueHolderImpl < Type > ( temporary ) {
if ( this->isLvalueRef ( ) && this->isTemporary ( ) )
throw std::domain_error ( "Lvalue references cannot be a temporarie." );
this->setData ( std::forward < Type > ( value ) );
}
@@ -123,21 +126,21 @@ public:
throw std::domain_error ( "Taking reference to a temporary" );*/
if ( ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::CONST ) && ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::LREF ) )
return std::make_shared < abstraction::ValueHolder < const std::decay_t < Type > & > > ( retrieveValue < const std::decay_t < Type > & > ( this->getProxyAbstraction ( ), move ), isTemporary );
return std::make_shared < abstraction::ValueHolder < const std::decay_t < Type > & > > ( retrieveValue < const std::decay_t < Type > & > ( this->shared_from_this ( ), move ), isTemporary );
else if ( ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::CONST ) && ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::RREF ) )
return std::make_shared < abstraction::ValueHolder < const std::decay_t < Type > && > > ( retrieveValue < const std::decay_t < Type > && > ( this->getProxyAbstraction ( ), move ), isTemporary );
return std::make_shared < abstraction::ValueHolder < const std::decay_t < Type > && > > ( retrieveValue < const std::decay_t < Type > && > ( this->shared_from_this ( ), move ), isTemporary );
else if ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::LREF )
return std::make_shared < abstraction::ValueHolder < std::decay_t < Type > & > > ( retrieveValue < std::decay_t < Type > & > ( this->getProxyAbstraction ( ), move ), isTemporary );
return std::make_shared < abstraction::ValueHolder < std::decay_t < Type > & > > ( retrieveValue < std::decay_t < Type > & > ( this->shared_from_this ( ), move ), isTemporary );
else if ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::RREF )
return std::make_shared < abstraction::ValueHolder < std::decay_t < Type > && > > ( retrieveValue < std::decay_t < Type > && > ( this->getProxyAbstraction ( ), move ), isTemporary );
return std::make_shared < abstraction::ValueHolder < std::decay_t < Type > && > > ( retrieveValue < std::decay_t < Type > && > ( this->shared_from_this ( ), move ), isTemporary );
else if constexpr ( std::is_abstract_v < std::decay_t < Type > > )
throw std::domain_error ( "Cannot declare value of abstract class." );
else if constexpr ( ! std::is_assignable_v < std::decay_t < Type > &, std::decay_t < Type > > )
throw std::domain_error ( "Cannot assign value." );
else if ( paramQualifierSet && ParamQualifiers::ParamQualifierSet::CONST )
return std::make_shared < abstraction::ValueHolder < const std::decay_t < Type > > > ( retrieveValue < const std::decay_t < Type > > ( this->getProxyAbstraction ( ), move ), isTemporary );
return std::make_shared < abstraction::ValueHolder < const std::decay_t < Type > > > ( retrieveValue < const std::decay_t < Type > > ( this->shared_from_this ( ), move ), isTemporary );
else
return std::make_shared < abstraction::ValueHolder < std::decay_t < Type > > > ( retrieveValue < std::decay_t < Type > > ( this->getProxyAbstraction ( ), move ), isTemporary );
return std::make_shared < abstraction::ValueHolder < std::decay_t < Type > > > ( retrieveValue < std::decay_t < Type > > ( this->shared_from_this ( ), move ), isTemporary );
}
abstraction::ParamQualifiers::ParamQualifierSet getTypeQualifiers ( ) const override {
Loading