Boost logo

Boost :

From: Alan Griffiths (alan_at_[hidden])
Date: 2000-04-08 05:23:59


In message <38ED6F42.BE30CA44_at_[hidden]>, Thomas Matelich
<sosedada_at_[hidden]> writes
>Platform: WinNT 4 SP6a
>Compiler: MSVC 6 SP3
>
>I was changing some #defines to be boost::uint32_t and included
><boost/cstdint.hpp> in a header.
>In one of my source files, cstdint.hpp gets pulled in, then
>smart_ptr.hpp gets pulled in. I now receive errors about auto_ptr not
>being defined in the standard namespace! I reverted back to all the
>#defines, and just left cstdint.hpp, and the error still occurs.
>Comment out the include and everything is hunky-dory. Just tried
>stdint.h and that works fine.
>
>Any ideas?

Two ideas:

/1/ It could be right and you have not included <memory>

/2/ The name lookup in MSVC is both wrong and flaky. If you insist on
using this compiler (I have to at work) then you suffer these problems.

Generally if at the top of your implementation file you pull all the
names you are using into global namespace and use the unqualified names
the problem won't manifest. Vis:

// headers including
#include <memory>

// Using directives including
using std::auto_ptr;

Yes, it looks a bit like Java, but it works with that most popular of
compilers.

-- 
Alan Griffiths  (alan_at_[hidden])  http://www.octopull.demon.co.uk/
ACCU Chairman   (chair_at_[hidden])             http://www.accu.org/

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