Skip to content

mlimber/VoidParam

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 

Repository files navigation

VoidParam Puzzle

In the code:

template <typename T> T Process(const T& t) { return t; } 

#define PROCESS(x) Process(x)

PROCESS can be called with any parameter except 'void', Process(void) is illegal, for instance code bellow won't compile:

void GetVoid() {}

PROCESS(GetVoid())

What modifications should be made that for all parameters other than 'void', PROCESS works as before, but call PROCESS(GetVoid()) (as well as PROCESS(void()) throws exception that 'void' is not allowed as a parameter. Function 'Process' above should remain without modifications.

About

VoidParam puzzle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%