當我聲明一個類靜態方法時,是否可以使用decltype(或以任何其他類似的樣式)引用當前類?例如, class
AAA
{
static AAA const make();
};
我想使這樣的事情。 class
AAA
{
static decltype(*this) const make(); // Not working because there's no
考慮下面的代碼: template <class Crtp>
struct Base
{
const float& get(const short int i) const {return std::get<0>(tuple);}
const double& get(const int i) const {return std::get<1>(tuple);}
c
我正在嘗試在標題中描述的事情。 template <class T>
void foo(const Foo* f) // this is general case template
{
}
// this should work only if T has static variable named _Foo with type const Foo*
template <class