> On 9 Apr 2018, at 16:55, Frank Heckenbach <f.heckenb...@fh-soft.de> wrote:
> 
> Hans Åberg wrote:
> 
>>>> But, anyway, GCC7 supports C++17.
>>> 
>>> Yes, and I've also tested it with gcc-6 with mpark's variant.
>> 
>> 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


> 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.



Reply via email to