Opened 21 years ago
Closed 21 years ago
#939 closed Feature Requests (None)
Turn on tmpl shared_ptr methods for MSVC
Reported by: | mred314 | Owned by: | nobody |
---|---|---|---|
Milestone: | Component: | None | |
Version: | None | Severity: | |
Keywords: | Cc: |
Description
Can you turn on the templated shared_ptr (copy?) constructor and assignment operator in MSVC++ (by checking for BOOST_MSVC6_MEMBER_TEMPLATES)? And/or publish the work-around (define a base class for templated shared_ptr) given in the Yahoo group? It's very useful. Three problems with simply turning them on, with workarounds (are there other problems?): (1) Compiler error. Just put the standard copy constructor and assignment operator after the template versions. (2) Silent failure if copying shared_ptr with same pointer type (MSVC++ generates its own copy constructor instead of using the templated constructor.) It works as long as the normal copy constructor is defined (which is already the case.) (3) No templated friends. Just don't do "private" (this workaround is already in place for other platforms.) Attached is smart_ptr.hpp (modified from 1_21_2) with the templated members simply turned on.
Note:
See TracTickets
for help on using tickets.