In this recipe, we will learn how to ensure a move constructor and a move assignment operator never throw an exception. The C++ specification doesn't prevent a move constructor from throwing (as it was determined that such a requirement would simply be too difficult to enforce, as too many legitimate examples exist even in the standard library). However, ensuring that exceptions are not thrown should be possible in most cases. Specifically, a move usually doesn't create resources but instead transfers resources and as a result, strong exception guarantees should be possible. A good example of a move that does create a resource is std::list, which must provide a valid end() iterator even on a move.
United States
Great Britain
India
Germany
France
Canada
Russia
Spain
Brazil
Australia
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Japan
Slovakia