What would ‘std:;’ do in c++?

std: its a label, usable as a target for goto. As pointed by @Adam Rosenfield in a comment, it is a legal label name. C++03 ยง6.1/1: Labels have their own name space and do not interfere with other identifiers.

What is the performance overhead of std::function?

There are, indeed, performance issues with std:function that must be taken into account whenever using it. The main strength of std::function, namely, its type-erasure mechanism, does not come for free, and we might (but not necessarily must) pay a price for that. std::function is a template class that wraps callable types. However, it is not … Read more

How is std::is_function implemented?

Let’s go over the conditions as they appear: If const T isn’t const (const doesn’t really apply to function types since functions aren’t objects), and T isn’t a reference (const doesn’t apply to references either for the same reason), it’s a function type. int (or any other non-function-non-reference type) wouldn’t fit in because is_const<const int>::value … Read more

Can a declaration affect the std namespace?

The language specification allows implementations to implement <cmath> by declaring (and defining) the standard functions in global namespace and then bringing them into namespace std by means of using-declarations. It is unspecified whether this approach is used 20.5.1.2 Headers 4 […] In the C++ standard library, however, the declarations (except for names which are defined … Read more

Why isn’t std::initializer_list a language built-in?

There were already examples of “core” language features that returned types defined in the std namespace. typeid returns std::type_info and (stretching a point perhaps) sizeof returns std::size_t. In the former case, you already need to include a standard header in order to use this so-called “core language” feature. Now, for initializer lists it happens that … Read more