|
Proto : |
Subject: Re: [proto] Using a derived class as terminals in Boost.proto
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2016-04-14 10:10:56
On 14 April 2016 at 14:43, Frank Winter <fwinter_at_[hidden]> wrote:
> Hi all!
>
> Suppose you'd want to implement a simple EDSL (Embedded Domain Specific
> Language) with Boost.proto with the following requirements:
>
> Custom class 'Vector' as terminal
> Classes derived from 'Vector' are working terminals too, e.g. Vector10
>
> [...]
template<typename T>
> struct IsVector
> : mpl::false_
> {};
>
>
> template<>
> struct IsVector< Vector >
> : mpl::true_
> {};
>
>
Surely this should be true for all types derived from Vector.
template<typename T, typename Enable = void>
struct IsVector
: mpl::false_
{};
template<typename T>
struct IsVector<T, typanem enable_if< is_base_of<Vector, T> >::type>
: mpl::true_
{};
Proto list run by eric at boostpro.com