I would like to overload operator<<(std::ostream&, std::chrono::duration<std::uint64, std::nano>) - and ideally without requiring user ...
I would like to overload operator<<(std::ostream&, std::chrono::duration<std::uint64, std::nano>) - and ideally without requiring user ...
I have the following code I compile with C++11. This code is a simplification of a real world usage. namespace bar { template<int M = 10> struc ...
When I program in C++, instead of writing using namespace std;, I generally tend to use std:: prefixed components like std::cout, std::cin etc. But th ...
The code below (Goldbolt) compiles and runs (on both gcc and clang) and does what I would hope. But I'm surprised! I expected to have to use an adl_se ...
Consider the following example: My understanding is that the expression Func(U{}) causes an unqualified name lookup of the function Func, and throu ...
I have a simple code with inheritance and shared_ptr from boost library. With standard c++20, the code compiles fine. The function calls to static_poi ...
static_pointer_cast resides in std namespace. Yet it takes pointers that are also in std namespace. So both std:: qualified calls and unqualified cal ...
Consider the following code: It's running properly. Obviously, it called this overload function(functor, strictly speaking): But after we intro ...
This actually compiles and works, but it's unclear to me why. I was previously calling f like f(3.1415927) before I let a lint checker talk me into ...
I have a function in my namespace. Its name is destroy. std namespace also contains a function with this name. When I call my function within my names ...
Why does taking the address of an inline friend not result in code being produced. This works for regular inline functions. Is the declaration not mat ...
I am new to c++ and I am trying to simply print out a vector of vectors from my Deck class in the main.cpp file. I think I need to overload the <&l ...
According to cppreference, in Argument-dependent lookups function names are looked up in the namespaces of their arguments in addition to the scop ...
I'm having a problem with concepts using ADL. edit 1: I mention ADL since the parse functions are supposed to be overloaded with user defined types. ...
It is possible to omit the std:: namespace for <algorithm>s when the argument types are in that namespace, which is usually the case. Is there a ...
Considering the following minimal example, function is not found for Option 1, while it is found for Option 2. Argument dependent lookup seems to fail ...
Consider the following valid C++20 code: Here, get<N> is able to be resolved through ADL thanks to a C++20 addition (http://www.open-std.org/ ...
Consider the code This is invalid C++ syntax - but I'm looking for something that works. I need to declare ::A::func(), but from within namespace B ...
I watched Klaus Iglberger give a great talk at CppCon 2021 about Type Erasure. I went to set up the pattern myself based on his example. His External ...
The code above compiles and run without problems, but I didn't get how the lookup for f(a) occurs. Initially will occur a unqualified name lookup in ...