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.
Germany
Slovakia
Canada
Brazil
Singapore
Hungary
Philippines
Mexico
Thailand
Ukraine
Luxembourg
Estonia
Lithuania
Norway
Chile
United States
Great Britain
India
Spain
South Korea
Ecuador
Colombia
Taiwan
Switzerland
Indonesia
Cyprus
Denmark
Finland
Poland
Malta
Czechia
New Zealand
Austria
Turkey
France
Sweden
Italy
Egypt
Belgium
Portugal
Slovenia
Ireland
Romania
Greece
Argentina
Malaysia
South Africa
Netherlands
Bulgaria
Latvia
Australia
Japan
Russia