Boost logo

Boost :

From: E. Gladyshev (egladysh_at_[hidden])
Date: 2003-10-28 20:58:37

--- Eric Friedman <ebf_at_[hidden]> wrote:
> What compiler are you using? (I'd guess MSVC6/7.) Anyhow, a workaround
> is possible for these broken compilers.

I tried MSVC6/7/7.1. I'll try GCC.

> I have also been considering the following syntax:
> apply_visitor( fail_if<T>(vis), var );

Looks fine to me. I think we understand what the problem is.
Even if other compilers work, I definitely don't
want to polute my visitors with the boost::empty overloads.
Whether it is fail_if<> or cannot_visit<>,
I trust your decision on how to solve this.
Is there any chance to get it into v1.31?

> Note as well that the upcoming type_switch will allow the following:
> R result = switch_<R>(var)
> |= case_<boost::empty>
> ( throw_some_exception() )
> |= default_
> ( do_something() )
> ;
> where, of course, 'throw_some_exception' and 'do_something' would be
> replaced by names of actual user-defined visitors or function objects.

The type switch is very cool!
But I don't see how it would help in my case?
The visitor doesn't have the whole variant handy,
It gets types controlled by a variant
not the variant itself.
So how do you use switch_<> in your visitor?


Do you Yahoo!?
Exclusive Video Premiere - Britney Spears

Boost list run by bdawes at, gregod at, cpdaniel at, john at