Use CATCH_NULL instead of NULL

- expands to nullptr if CATCH_CONFIG_CPP11_NULLPTR is defined (see #444)
This commit is contained in:
Phil Nash
2015-07-01 07:33:27 +01:00
parent 3b18d9e962
commit 805de43a3d
25 changed files with 112 additions and 101 deletions

View File

@@ -264,11 +264,11 @@ namespace Clara {
template<typename ConfigT>
class BoundArgFunction {
public:
BoundArgFunction() : functionObj( NULL ) {}
BoundArgFunction() : functionObj( CATCH_NULL ) {}
BoundArgFunction( IArgFunction<ConfigT>* _functionObj ) : functionObj( _functionObj ) {}
BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : NULL ) {}
BoundArgFunction( BoundArgFunction const& other ) : functionObj( other.functionObj ? other.functionObj->clone() : CATCH_NULL ) {}
BoundArgFunction& operator = ( BoundArgFunction const& other ) {
IArgFunction<ConfigT>* newFunctionObj = other.functionObj ? other.functionObj->clone() : NULL;
IArgFunction<ConfigT>* newFunctionObj = other.functionObj ? other.functionObj->clone() : CATCH_NULL;
delete functionObj;
functionObj = newFunctionObj;
return *this;
@@ -284,7 +284,7 @@ namespace Clara {
bool takesArg() const { return functionObj->takesArg(); }
bool isSet() const {
return functionObj != NULL;
return functionObj != CATCH_NULL;
}
private:
IArgFunction<ConfigT>* functionObj;