Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 8, 2008, 7:02:46 PM (16 years ago)
Author:
landauf
Message:

hopefully solved the conversion problem :)

it's a lot of metaprogramming now but this reduces the risk getting unnecessary compiler errors:
if (convert(a, b))

return true;

else

return convertFallback(a, b);

if convert(a, b) is defined and always used you could still get an error if convertFallback(a, b) uses something (like stream << object) that isn't supported for a or b. but with some template tricks it's possible to not even consider using convertFallback(a, b) at compiletime and avoid the error as long as convert(a, b) is implemented.

util/Conver.h is now opened for curious coders ;)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core2/src/orxonox/core/Functor.h

    r1001 r1003  
    325325            void operator()(const MultiTypeMath& param1 = MT_null, const MultiTypeMath& param2 = MT_null, const MultiTypeMath& param3 = MT_null, const MultiTypeMath& param4 = MT_null, const MultiTypeMath& param5 = MT_null) \
    326326            { \
    327                 std::cout << "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" << std::endl; \
    328                 std::cout << param1 << std::endl; \
    329                 std::cout << this->getTypenameParam(0) << std::endl; \
    330327                FUNCTOR_STORE_RETURNVALUE(returnvalue, (*this->functionPointer_)(FUNCTOR_FUNCTION_CALL(numparams))); \
    331                 std::cout << "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb" << std::endl; \
    332328            } \
    333329    \
Note: See TracChangeset for help on using the changeset viewer.