Skip to content

fidus58/String-Proxy-Puzzle

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 

Repository files navigation

String Proxy Puzzle

C-style string cannot be used as a template parameter (X<"abc">() won't compile).
It is possible for any C-style string to use it's proxy as a template parameter and reconstruct the compile-time string from it. Program below demonstrates it. Code can be modified only in the places where PUZZLE is.

// No headers

template <typename T> 
constexpr auto StringProxy()
{
  PUZZLE 
}

static_assert(StringProxy<PUZZLE>() == "StringProxy", "");
                                                           
int main() { return 0; }

About

String Proxy Puzzle

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors