diff --git a/libwccl/ops/constant.h b/libwccl/ops/constant.h index 32d8a950ccfc03d677e9ae82c180827128053456..67f15ef1dca997168dc1f6188785272a614e7442 100644 --- a/libwccl/ops/constant.h +++ b/libwccl/ops/constant.h @@ -12,15 +12,15 @@ namespace Wccl { /** * Functional realisation of constant value of a given type */ -template<class TRet> -class Constant : public Function<TRet> { - BOOST_CONCEPT_ASSERT((boost::CopyConstructible<TRet>)); +template<class T> +class Constant : public Function<T> { + BOOST_CONCEPT_ASSERT((boost::CopyConstructible<T>)); public: /* * Constant function holds specific value to return when applying it */ - Constant(const TRet& value) - : value_(new TRet(value)) + Constant(const T& value) + : value_(new T(value)) { BOOST_ASSERT(value_); } @@ -47,11 +47,11 @@ protected : * Applying Constant function returns the held value of a constant */ virtual BaseRetValPtr apply_internal(const SentenceContext&) const { - return BaseRetValPtr (new TRet(*value_)); + return BaseRetValPtr (new T(*value_)); } private: - const boost::scoped_ptr<const TRet> value_; + const boost::scoped_ptr<const T> value_; }; diff --git a/libwccl/ops/functions.h b/libwccl/ops/functions.h index 9db64d7ee197d9df44a1912ff1ed8bef585e40ef..81395756b0a278b44deed8754719a031e8cb17b8 100644 --- a/libwccl/ops/functions.h +++ b/libwccl/ops/functions.h @@ -28,16 +28,16 @@ protected: * Abstract base class template for functional WCCL operators that are functions * returning a value of given type */ -template<class TRet> +template<class T> class Function : public FunctionBase { - BOOST_MPL_ASSERT( (boost::is_base_of<Value, TRet>) ); - BOOST_MPL_ASSERT_NOT( (boost::is_same<Value, TRet>) ); + BOOST_MPL_ASSERT( (boost::is_base_of<Value, T>) ); + BOOST_MPL_ASSERT_NOT( (boost::is_same<Value, T>) ); public: /** * Type returned after application of function (shared pointer to * a variable of the specified return type) */ - typedef boost::shared_ptr<TRet> RetValPtr; + typedef boost::shared_ptr<T> RetValPtr; /** * Applies the function, given the sentence context, returning specific @@ -45,7 +45,7 @@ public: * be specified in derived classes. */ RetValPtr apply(const SentenceContext& context) const { - RetValPtr v = boost::dynamic_pointer_cast<TRet>(apply_internal(context)); + RetValPtr v = boost::dynamic_pointer_cast<T>(apply_internal(context)); BOOST_ASSERT(v); return v; }