A RetroSearch Logo

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

Search Query:

Showing content from https://en.cppreference.com/w/cpp/language/../memory/voidify.html below:

voidify - cppreference.com

template< class T >
void* voidify( T& obj ) noexcept;

(exposition only*)
(constexpr since C++17)

Returns the address of obj (implicitly converted to void*).

[edit] Parameters obj - the object whose address will be taken [edit] Return value [edit] Notes

This exposition-only function is introduced by P0896R4. It is used to describe the effects of uninitialized memory algorithms which construct objects in uninitialized memory areas. The result pointer is used as the placement-params of a placement new expression.

Initially, the return value was const_cast<void*>(static_cast<const volatile void*>(std::addressof(obj))), which breaks const-correctness. The explicit casts were removed by the resolution of LWG issue 3870, and the only conversion left is the implicit conversion to void*.

[edit] Defect reports

The following behavior-changing defect reports were applied retroactively to previously published C++ standards.

DR Applied to Behavior as published Correct behavior LWG 3870 C++98 the explicit casts broke const-correctness removed these casts [edit] See also

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