Boost logo

Boost :

Subject: Re: [boost] [constrained-value] Some observations and questions.
From: Robert Kawulak (robert.kawulak_at_[hidden])
Date: 2009-02-08 23:52:01


> From: Jeroen N. Witmond [Bahco]

> I also installed file boost/utility/swap.hpp from the sandbox. I had to hack
> the example program[4] to get around "[boost] [utility/swap] Ambiguous
> overload"[5].

The examples should work fine with swap.hpp taken from trunk - I haven't tried
them with the sandbox version, but I guess it is an older one.

> In the section on Custom error policies in the example program,
> perhaps it should be explicitely stated that:

[snip policy contracts]

Interfaces and semantics of the policies are described here in the Parameters section. I will also add a section
about the policies in the documentation, as suggested by Stjepan Rajko.

> So I wrote four template classes[10] [...] They can used like teir base type.

Not exactly. The problem with inheriting from constrained is that the resulting
class is no longer implicitly convertible to the underlying type. This makes it
incompatible with the underlying type in even more situations than constrained

> One thing that has gotten me completely stumped is deriving my own
> template class from constrained_value::unconstrained. Whatever I try,
> I get the weirdest of compiler error messages.

unconstrained is a template alias for constrained, so you should write

Best regards,

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