The following doesn\'t compile under g++ 8.1.0 on CentOS 7:
hey.h
#pragma once
#include
#include
c
The matching of expressions in template declarations is based on equivalence, a concept based on the one-definition rule. For two expressions to be considered equivalent, they must be at least token-by-token identical modulo the renaming of template parameters.
The expressions is_valid<T>()
and Hey::is_valid<T>()
are not equivalent (the second has two tokens the first doesn't have), and so the compiler is not required to match them.
Hey::EnableType<T>
is a type, and is not subject to the strict equivalence rules for expressions.