Python
Java
PHP
IOS
Android
Nodejs
JavaScript
Html5
Windows
Ubuntu
Linux
ADL 是否适用于全局命名空间?
Examples https stackoverflow com a 5076640 321013 such as https groups google com forum original comp lang c moderated 1
c
namespaces
Using
argumentdependentlookup
globalnamespace
C++ 运算符查找规则 / Koenig 查找
在编写测试套件时 我需要提供一个实现operator lt lt std ostream 供 Boost 单元测试使用 这有效 namespace theseus namespace core std ostream operator lt
c
argumentdependentlookup
两阶段函数模板编译:第二阶段不*仅*使用ADL?
我想知道为什么以下代码 https wandbox org permlink lOVCxA1aY7HZejfV编译 include
c
templates
languagelawyer
argumentdependentlookup
namelookup
为什么参数依赖查找不适用于函数模板dynamic_pointer_cast
考虑以下 C 程序 include
c
argumentdependentlookup
什么是“参数相关查找”(又名 ADL 或“Koenig 查找”)?
关于什么是参数依赖查找有哪些好的解释 许多人也将其称为 Koenig Lookup 我最好想知道 为什么这是一件好事 为什么这是一件坏事 它是如何工作的 柯尼希查找 or 参数相关查找 http en wikipedia org wiki
c
argumentdependentlookup
namelookup
cfaq
Lambda、本地类型和全局命名空间
这个最小程序 template
c
gcc
Lambda
Clang
argumentdependentlookup
通过使用指令调用开始和结束?
既定的调用习惯用法swap is using std swap swap foo bar 这边走 swap可以对外部的用户定义类型进行重载std命名空间 我们应该调用begin and end以同样的方式 using std begin u
c
C11
STL
usingdirectives
argumentdependentlookup
为什么(不相关的)using 声明可以通过参数依赖查找来协调重载歧义?
这是问题的后续here https stackoverflow com questions 46782156 does argument dependent lookup go before normal scope lookup使用参数相
c
scope
namespaces
argumentdependentlookup
usingdeclaration
使用声明隐藏名称
include
c
SWAP
Using
argumentdependentlookup
namelookup
嵌套类和 ADL
这是代码 namespace Namespace struct L0 enum SomeEnum EnumVal struct L1 friend void f SomeEnum std cout lt lt f lt lt std end
c
class
enums
nested
argumentdependentlookup
将相等运算符与 boost::Optional 一起使用
我试图为另一个命名空间中定义的类型 T 定义一个相等运算符 然后在optional
c
boost
argumentdependentlookup
从元组中获取元素[重复]
这个问题在这里已经有答案了 可能的重复 为什么 ADL 找不到函数模板 https stackoverflow com questions 2953684 why doesnt adl find function templates Cal
c
templates
tuples
C11
argumentdependentlookup
模板对象的模板友元函数和命名空间
在以下 C 示例代码中 GCC 6 和 Clang 3 8 对正确行为的看法不一致 这个人为的例子 有效 如test 函数返回o p在海湾合作委员会 在 clang 中 它调用 未定义 函数get
c
templates
friend
argumentdependentlookup
如何避免通过参数依赖查找显式专门化模板化函数
So 我已经写了一个答案 https stackoverflow com a 41125514 2642059它使用模板化函数来选择对象类型 我已经定义了类型 struct pt double t double e double c vis
c
Runtime
specialization
argumentdependentlookup
functiontemplates
std::vector
的比较运算符无法找到 T 的比较运算符
以下非常简单的代码将无法编译 include
如何调用与成员函数同名的内联友元函数?
如此处所述C 11 风格的 SFINAE 和模板实例化上的函数可见性类成员函数掩盖了自由函数 使用完全限定名称通常是有效的 但是我在使用内联声明的其他类的友元函数时遇到了困难 考虑以下示例 namespace N struct C frie
c
friend
overloadresolution
argumentdependentlookup
ADL 何时应用?
有3个例子 I typedef int foo namespace B struct S operator int return 24 int foo B S s return 0 int main int t foo B S 24 ADL
c
languagelawyer
argumentdependentlookup
是否可以创建一个特征来回答类型是否来自 std?
After 这个问题通过利用 ADL 我们可以创建一个特征来回答传递的类型是否来自我们的命名空间 include
c
C11
templates
typetraits
argumentdependentlookup
为什么要发明参数依赖查找?
为什么要发明参数依赖查找 ADL 难道只是为了让我们可以写cout lt lt stuff代替std operator lt lt cout stuff 如果是这样的话 为什么 ADL 不限于运算符而不是所有函数 如果 C 有其他方法来执行
c
history
argumentdependentlookup
为什么两阶段查找无法选择“swap”的重载版本?
我在学习这个令人着迷的答案 to a 微妙的问题关于实施的最佳实践swap用户定义类型的函数 我的问题最初是由讨论向命名空间添加类型的非法性std 我不会在此处重新打印上述链接答案中的代码片段 相反 我想理解答案 我在上面链接的答案在第一个
c
templates
C11
SWAP
argumentdependentlookup
1
2
»