Код: Выделить всё
template
constexpr bool is_valid = true;
template
class Nesting
{
public:
template requires is_valid
class Inner;
};
template
template requires is_valid
class Nesting::Inner
{
public:
static inline void Do();
};
#include
template
template requires is_valid
inline void Nesting::Inner::Do()
{
std::cout
с < /p>
:14:31: error: requires clause differs in template redeclaration
14 | template requires is_valid
| ^
:8:35: note: previous template declaration is here
8 | template requires is_valid
| ^
:25:35: error: out-of-line definition of 'Do' from class 'Inner' without definition
25 | inline void Nesting::Inner::Do()
| ~~~~~~~~~~~~~~~~~~~~~~^
:31:19: error: implicit instantiation of undefined template 'Nesting::Inner'
31 | Nesting::Inner::Do();
| ^
:9:11: note: template is declared here
9 | class Inner;
Подробнее здесь: https://stackoverflow.com/questions/796 ... works-with