Opened 12 years ago

Closed 12 years ago

#4892 closed Patches (fixed)

boost::make_shared doesn't use r-value ref support unless variadic templates are also supported

Reported by: arnetheduck@… Owned by: Peter Dimov
Milestone: To Be Determined Component: smart_ptr
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

Currently, boost::make_shared doesn't make use of r-value references unless there is also support for variadic templates ("#if defined( BOOST_HAS_VARIADIC_TMPL ) && defined( BOOST_HAS_RVALUE_REFS )").

At least one popular compiler supports rvalue refs but unfortunately not variadic templates (MSVC 10.0), so the implementation falls back on the pre-c++0x implementation.

The attached file improves the situation by adding make_shared support for up to 10 perfectly forwarded constructor arguments.

Attachments (1)

boost_make_shared.hpp (31.9 KB ) - added by anonymous 12 years ago.

Download all attachments as: .zip

Change History (7)

by anonymous, 12 years ago

Attachment: boost_make_shared.hpp added

comment:1 by Vicente Botet <vicente.botet@…>, 12 years ago

Type: BugsPatches

If the current implementation doesn't make any code to work incorrectly this should be a Feature request.

comment:2 by arnetheduck@…, 12 years ago

Type: PatchesFeature Requests

To be honest, I missed that field when creating the ticket, thanks for changing...it's actually an enhancement to an existing feature, so "patches" feels natural although any classification will do as long as it catches Mr Dimov's attention =)

comment:3 by anonymous, 12 years ago

Type: Feature RequestsPatches

comment:4 by Peter Dimov, 12 years ago

(In [69244]) Apply patch to allow perfect forwarding without variadics. Refs #4892.

comment:5 by Peter Dimov, 12 years ago

Status: newassigned

comment:6 by Peter Dimov, 12 years ago

Resolution: fixed
Status: assignedclosed

(In [70433]) Merge [69244] to release. Fixes #4892.

Note: See TracTickets for help on using tickets.