Boost logo

Boost Users :

From: Andrew McDonald (andrew.mcdonald_at_[hidden])
Date: 2006-07-24 04:35:26


I am using VC++ 2005 Express Edition v 8.0.050727.42.

When compiling the following line in a file example.cpp;

boost::shared_ptr<int> p(new std::string)

the following error is produced (note the explicit mention of example.cpp(10) ):

c:\Projects\boost\shared_ptr.hpp(125) : error C2440: 'initializing' : cannot convert from 'std::string *' to 'int *'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
        .\example.cpp(10) : see reference to function template instantiation 'boost::shared_ptr<T>::shared_ptr<std::string>(Y *)' being compiled
        with
        [
            T=int,
            Y=std::string
        ]

regards,

Andrew McDonald
System Architect

Norwood Systems Australia Pty Ltd
Level 1, 71 Troy Terrace
PO Box 1281
Subiaco, WA 6904

Tel +61 8 9380 7766
Fax +61 8 9380 7733
  
The information in this email, and any attachments, may contain confidential information and is intended solely for the attention and use of the named addressee (s). It must not be disclosed to any person(s) without authorization. If you are not the intended recipient, or a person responsible for delivering it to the intended recipient, you are not authorized to, and must not, disclose, copy, distribute, or retain this message or any part of it. If you have received this communication in error, please notify the sender immediately.


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