Boost logo

Boost :

From: Fernando Cacciola (fernando_cacciola_at_[hidden])
Date: 2004-01-14 08:17:16


Pavel Vozenilek <pavel_vozenilek_at_[hidden]> wrote in message
news:bu38fh$fq7$1_at_sea.gmane.org...
> BCB 6.4:
>
> char text[260];
> boost::optional<AnsiString>(text);
>
> fails with error message:
>
> [C++ Error] optional.hpp(419): E2285 Could not find a match for
> 'optional_detail::optional_base<AnsiString>::optional_base(const char
> *,const char *)'
> Full parser context
> optional.hpp(419): decision to instantiate:
> optional<AnsiString>::optional(char ( &) const[260])
> --- Resetting parser context for instantiation...
> shell_extension_folder_browser.cpp(3): #include C:\G\src\common.h
> common.h(60): #include C:\boost\boost_1_31_0_rc1\boost/optional.hpp
> optional.hpp(78): namespace boost
> optional.hpp(363): class optional<T>
> optional.hpp(419): parsing: optional<AnsiString>::optional(char ( &)
> const[260])
>
>
> It worked in 1.30.2.
>
> Using:
> boost::optional<AnsiString>(AnsiString(text));
> fixes it but maybe it should work off the shelf.
>
> /Pavel
>
Oh... that's the effect of the new constructor overloads for in-place
factories.
I'm afraid direct construction via implicit conversion to value_type are no
longer supported now.
If you need backward compatibility (i.e. can't change your code to use fully
constructed AnsiString objects)
you can define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT to disable the
extra overloads that causes the ambiguity.

HTH

Fernando Cacciola
SciSoft


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk