source: mainline/uspace/lib/cpp/include/__bits/memory/addressof.hpp@ 8624d1f

Last change on this file since 8624d1f was b57ba05, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 3 years ago

Update headers in C++ files

  • Property mode set to 100644
File size: 464 bytes
Line 
1/*
2 * SPDX-FileCopyrightText: 2018 Jaroslav Jindrak
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef LIBCPP_BITS_MEMORY_ADDRESSOF
8#define LIBCPP_BITS_MEMORY_ADDRESSOF
9
10namespace std
11{
12 /**
13 * 20.7.12, specialized algorithms:
14 */
15
16 template<class T>
17 T* addressof(T& x) noexcept
18 {
19 return reinterpret_cast<T*>(
20 &const_cast<char&>(
21 reinterpret_cast<const volatile char&>(x)
22 ));
23 }
24}
25
26#endif
Note: See TracBrowser for help on using the repository browser.