Boost logo

Boost :

From: SourceForge.net (noreply_at_[hidden])
Date: 2005-11-16 20:09:35


Bugs item #1358600, was opened at 2005-11-17 11:39
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1358600&group_id=7586

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Sergey Shandar (sergey_shandar)
Assigned to: Nobody/Anonymous (nobody)
Summary: lexical_cast & pure virtual functions & VC 8 STL

Initial Comment:
VC 8.0 can't compile the valid code:
===== =====
#include <boost/lexical_cast.hpp>

class A
{
public:
        virtual void out(std::ostream &) const = 0;
};

class B: public A
{
public:
        virtual void out(std::ostream &O) const { O << "B"; }
};

std::ostream &operator<<(std::ostream &O, const A &a)
{
        a.out(O);
        return O;
};

int main()
{
        const A &a = B();
        boost::lexical_cast<std::string>(a);
        return 0;
}
===== =====

The problem occurs in VC STL:
===== =====
c:\program files\microsoft visual studio
8\vc\include\limits(102) : error C2259: 'A' : cannot
instantiate abstract class
===== =====
However, should boost::lexical_cast use
std::numeric_cast in this case?

----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=107586&aid=1358600&group_id=7586

-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc. Get Certified Today
Register for a JBoss Training Course. Free Certification Exam
for All Training Attendees Through End of 2005. For more info visit:
http://ads.osdn.com/?ad_id=7628&alloc_id=16845&op=click
_______________________________________________
Boost-bugs mailing list
Boost-bugs_at_[hidden]
https://lists.sourceforge.net/lists/listinfo/boost-bugs


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