Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > BOOK: Professional C++, 2nd Edition
BOOK: Professional C++, 2nd Edition
This is the forum to discuss the Wrox book Professional C++, 2nd Edition by Marc Gregoire, Nicholas A. Solter, Scott J. Kleper ; ISBN: 978-1-1181-6995-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++, 2nd Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old January 11th, 2013, 10:35 AM
Registered User
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default g++ 4.7.1: noexcept for the move constructor

In g++ 4.7.1, it seems that the noexcept keyword is mandatory for the move constructor of a class.
For instance, without noexcept, the container vector calls the standard copy constructor instead of the move constructor when an internal reallocation is needed (push_back).
Old January 12th, 2013, 10:54 AM
Wrox Author
Join Date: Mar 2011
Posts: 49
Thanks: 0
Thanked 4 Times in 4 Posts

I'm not sure if that's correct behavior. For example, the implicitly declared move constructor doesn't specify noexcept.
The C++ standard says:
The implicitly-declared move constructor for class X will have the form

Similar Threads
Thread Thread Starter Forum Replies Last Post
vb 2010 datatable move next, move previouse bigway .NET 4 and Visual Studio 2010 General Discussions 1 July 13th, 2011 03:55 AM
How do you move the mouse outside the form and to move diagonally? fangzhien Visual Studio 2005 0 July 28th, 2009 10:06 PM
Constructor nayeem69 .NET Framework 2.0 1 July 17th, 2007 12:33 AM
Constructor ramess C++ Programming 1 March 18th, 2006 07:23 PM
Constructor problem yengzhai C++ Programming 6 May 18th, 2005 11:05 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.