简体   繁体   English

是否有标准的C ++函数,类似于Address-of运算符&?

[英]Is there a standard C++ function, that is analogue to Address-of operator &?

是否有一个标准的C ++函数,它类似于Address-of运算符&,我可以用作stl实体的函数对象,如std :: transform和std :: compose1?

std::addressof could suit your purpose. std::addressof可能适合您的目的。 Note that the behaviour is slightly different to plain operator& if the type has an overload for that operator. 请注意,行为与普通operator&略有不同,如果类型具有该运算符的重载。

我认为你要找的是std::addressof

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有关“ C和C ++中的“地址运算符”(&)和数组的问题 - Questions about “Address-of operator” (&) and arrays in c and c++ C ++:地址的取消引用和地址的取消引用 - C++: Address-of dereference and dereference of an address-of 为什么address-of operator(&#39;&&#39;)可以与在C ++中使用寄存器存储类说明符声明的对象一起使用? - Why address-of operator ('&') can be used with objects that are declared with the register storage class specifier in C++? 映射函数的C ++模拟 - C++ analogue of mapping function 运算符地址(&)与参考运算符(&) - Address-of operator (&) vs reference operator(&) 地址(&)运算符传递的指针无效 - Invalid Pointer Passed By Address-of(&) Operator 地址 (&amp;) 运算符的返回类型是什么? - What is the return type of address-of (&) operator? 为什么将函数名用作函数指针等同于将地址运算符应用于函数名? - Why is using the function name as a function pointer equivalent to applying the address-of operator to the function name? C ++-&lt;&lt;运算符重载,链表-地址而不是标准输出 - C++ - << operator overloading, linked list - address instead of standard output 为什么必须使用地址运算符获取指向成员函数的指针? - Why must I use address-of operator to get a pointer to a member function?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM