Boost logo

Boost Users :

From: Emil Dotchevski (emil_at_[hidden])
Date: 2008-04-14 14:49:51


I think the problem is that you're missing the aliasing support in
shared_ptr which was added to the boost trunk at revision 37402 and is
used by Boost Exception.

-- 
Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode
On Sat, Apr 12, 2008 at 11:25 AM, Olaf Peter <ope-devel_at_[hidden]> wrote:
> Hi,
>
> I've used the boost.exception from svn (Revision 44352) and got the
> compile errors:
>
> $ LANG=en g++ -I ../../3rd_party/boost-svn/ -Wall eh.cpp -o eh && ./eh
> ../../3rd_party/boost-svn/boost/exception/info.hpp: In function
> 'boost::shared_ptr<const typename ErrorInfo::value_type>
> boost::get_error_info(const E&) [with ErrorInfo =
> boost::error_info<boost::tag_throw_function, const char*>, E =
> boost::exception]':
> eh.cpp:21:   instantiated from here
> ../../boost-svn/boost/exception/info.hpp:104: error: no matching
> function for call to 'boost::shared_ptr<const char*
> const>::shared_ptr(boost::shared_ptr<const
> boost::exception_detail::error_info_base>&, const char* const*)'
> /usr/include/boost/shared_ptr.hpp:144: note: candidates are:
> boost::shared_ptr<T>::shared_ptr() [with T = const char* const]
> /usr/include/boost/shared_ptr.hpp:131: note:
> boost::shared_ptr<const char* const>::shared_ptr(const
> boost::shared_ptr<const char* const>&)
>
>
> from this file:
>
> #include <boost/exception/exception.hpp>
> #include <boost/exception/info_tuple.hpp>
> #include <boost/exception/info.hpp>
> #include <exception>
> #include <boost/shared_ptr.hpp>
>
> #include <iostream>
>
> struct test_exception : boost::exception {};
>
> int main()
> {
>     try {
>         throw test_exception()
>             << BOOST_ERROR_INFO
>             ;
>     }
>     catch( const boost::exception& e ) {
>         using namespace boost;
>         std::cerr << "Caught exception:\n" << e.what() << "\n";
>         shared_ptr<const char * const> function =
> get_error_info<throw_function>( e );
> //         shared_ptr<const char * const> file =
> get_error_info<throw_file>( e );
> //         shared_ptr<int* const>    line = get_error_info<throw_line>( e );
> //         std::cerr << "  in " << file << "(" << line << "): " <<
> function << std::endl;
>     }
> }
>
>
> BTW, the example_io.cpp doesn't compile too. Do I have to use the
> complete svn trunk?
>
> Thanks,
> Olaf
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net