Boost logo

Boost Users :

Subject: Re: [Boost-users] boost::variant and SFINAE
From: Sebastian Redl (sebastian.redl_at_[hidden])
Date: 2009-12-03 18:02:09

Jonathan Chambers` wrote:
> I'm trying to get the program to compile if the variant takes on the
> guise of an int (because I've implemented void operator()(int &i)
> const, but not compile if I make the variant take the guise of a char
> e.g. boost::variant<int, char> var = 'a'; because I've not implemented
> the void operator()(char &c) const

The value (and thus actual type) of a variant is a runtime property;
there cannot be a way to achieve what you want.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at