I am trying to declare a strongly typed actor in the C ++ actionor framework (CAF) , but my code does not compile for some reason. Could you tell me what is wrong with him?
template <typename TNum>
class DiscoverRequest {};
template <typename TNum>
class DiscoverResponse {};
template <typename TNum>
class DataRequest {};
template <typename TNum>
class DataResponse {};
template <typename TNum>
using BlockActor = caf::typed_actor<
/* ERROR NEXT LINE */
caf::replies_to<DiscoverRequest<TNum>>::with<DiscoverResponse<TNum>>,
caf::replies_to<DataRequest<TNum>> ::with<DataResponse<TNum>> >;
Error message:
Block.hh:13:71: error: type/value mismatch at argument 1 in template
parameter list for 'template<class ... Sigs> class caf::typed_actor'
caf::replies_to<DiscoverRequest<TNum>>::with<DiscoverResponse<TNum>>,
^
Block.hh:13:71: error: expected a type, got
'(caf::replies_to<DiscoverRequest<TNum> >::with < <expression error>)'
But if I replaced DiscoverRequest<TNum>it DiscoverResponse<TNum>with specific instances, for example DiscoverRequest<float>, it compiles fine. So, I think something in the CAF internals prohibits the use of such a construct.
My compiler is GCC g ++ 4.9.2 (with -std=c++11, of course) running on Fedora 21. CAF is the latest version of its branch masterrelated to the project as a submodule of Git.
source
share