bug-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: C++17 skeleton with move semantics and std::variant


From: Frank Heckenbach
Subject: Re: C++17 skeleton with move semantics and std::variant
Date: Mon, 09 Apr 2018 18:16:35 +0200

Hans Åberg wrote:

> >> One can have a preprocessor macro '#if (__cplusplus == 201703L) ...', 
> >> would it be of interest.
> > 
> > What would it do? (BTW, I think it should be ">=".)
> 
> Something like, but with suitable template arguments:
> 
> #if !(__cplusplus >= 201703L)
> namespace std {
>   // Workaround when C++17 <variant> not available.
>   template<class T>
>   using variant = some::variant<T>;
> }
> #endif

(Or simply "namespace std { using mpark::variant; }", I think.)

> > I don't want the skeleton to depend on an external library (and as I
> > said, there might be at least two candidates), so I think it's
> > better to leave it to the user. (For me, I've put mpark's variant
> > header in /usr/local/include for g++-6 to use, while g++-7 will use
> > its own variant implementation, so the parser will work with both
> > compilers without change.)
> 
> Indeed, leave as it is. The idea above would leave it open for other users to 
> introduce their own dependencies.

I think so. With the various "%code" blocks etc., there are enough
possibilities for users to do the above or similar.

Regards,
Frank



reply via email to

[Prev in Thread] Current Thread [Next in Thread]