A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cplusplus.github.io/LWG/issue2389 below:

operator= is over-specified and handles allocators incorrectly

In the following descriptions, let ALLOCATOR_OF(f) be the allocator specified in the construction of function f, or allocator<char>() if no allocator was specified.

function& operator=(const function& f);

-5- Effects: function(allocator_arg, get_memory_resource() ALLOCATOR_OF(*this), f).swap(*this);

[…]
function& operator=(function&& f);

-8- Effects: function(allocator_arg, get_memory_resource() ALLOCATOR_OF(*this), std::move(f)).swap(*this);

[…]
function& operator=(nullptr_t);

-11- Effects: If *this != NULL, destroys the target of this.

-12- Postconditions: !(*this). The memory resource returned by get_memory_resource() after the assignment is equivalent to the memory resource before the assignment. [Note: the address returned by get_memory_resource() might change — end note] -13- Returns: *this
template<class F> function& operator=(F&& f);

-15- Effects: function(allocator_arg, get_memory_resource() ALLOCATOR_OF(*this), std::forward<F>(f)).swap(*this);

[…]
template<class F> function& operator=(reference_wrapper<F> f);

-18- Effects: function(allocator_arg, get_memory_resource() ALLOCATOR_OF(*this), f).swap(*this);

[…]

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4