My company doesn'开发者_如何学Ct allow the use of boost
(for many stupid reasons, but that's off-topic).
I feel very frustrated having to use raw pointers when I'm used to shared_ptr
, weak_ptr
and scoped_ptr
for personal development.
We're working exclusively with Microsoft compilers (Visual Studio 2010) and I wonder if there was an alternative to those templates that would decrease my pain.
I once heard of std::tr1
but I'm not sure what this is. I believe it is some kind of Microsoft implementation of the next standard but can we rely on it ? What does it provide ? Is there any guarantees ? What headers should be included ?
With VC10 just use the shared_ptr
, weak_ptr
and unique_ptr
implementations it already provides. All you have to do is to include <memory>
.
TR1 is short for Technical Report 1 and are recommendations to the standard committee for new features in the C++ standard. take a look at the header (or other headers that it includes). and if VS2010 implements TR1 there is a good chance you will have the tr1 smart pointers. These should be identical to the Boost smart pointers.
精彩评论