Opened 7 years ago

Closed 4 years ago

#11479 closed Bugs (duplicate)

BOOST_DEFAULTED_FUNCTION does not work on Visual Studio 2013

Reported by: randomaccessiterator@… Owned by: John Maddock
Milestone: To Be Determined Component: config
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

The following use case

struct Foo {

Foo(const Foo& other) : uptr(new int(*other.uptr)) {} BOOST_DEFAULTED_FUNCTION(Foo(Foo&& other), : uptr(std::move(other.uptr)){} ); std::unique_ptr<int> uptr;

};

when compiled with Visual Studio 2013, causes the following error:

error C2610: 'Foo::Foo(Foo &&)' : is not a special member function which can be defaulted

VS 2012 picks up the fallback, so it works.

It could be because of the following documented defect: https://msdn.microsoft.com/en-us/library/hh567368.aspx#rvref

Change History (2)

comment:1 by viboes, 7 years ago

Component: Noneconfig
Owner: set to John Maddock

comment:2 by John Maddock, 4 years ago

Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.