标准是否指定哪些函数被声明为内联?

Does the standard specify which functions are declared inline?

那么问题来了,最新的标准是否规定了标准C++库中的函数何时声明为内联或不声明?

查看来自 Clang、GCC 和 MSVC 实现的 algorithm 头文件,除了 constexpr 之外的每个函数都被声明为内联。

我打算继续问什么时候内联什么不内联,但我不想就编译器如何更好地了解或微优化进行通常的争论,所以我什至不应该让这句话留在问题中。哦等等...

没有。实现作者选择。

[C++14: 17.6.5.4/1]: It is unspecified whether any global or non-member functions in the C++ standard library are defined as inline (7.1.2).

[C++14: 17.6.5.5/1]: It is unspecified whether any member functions in the C++ standard library are defined as inline (7.1.2).

回想一下,这与如今的实际内联无关;它实际上只影响 ODR。