Код: Выделить всё
template
class derived
{
template
void do_stuff() { (...) }
void do_stuff(size_t size) { (...) }
public:
void execute()
{
if constexpr(is_constexpr(base::get_data())
{
do_stuff();
}
else
{
do_stuff(base::get_data());
}
}
};
Я нашел следующую ветку на Reddit, но я не большой поклонник макросов. https://www.reddit.com/r/cpp/comments/7 ... xpression/
Подробнее здесь: https://stackoverflow.com/questions/552 ... -constexpr
Мобильная версия