Manipulating variables at compile time with C++ -


since lost track of c++11 , c++14 (not out yet suppose) changes, wondering if following possible in c++ or if there plan make working: need way query class or function whether uses variable or not. if not, should able add variable used in higher scope (either caller function or code instantiates class).

i can @ runtime has performance penalty can't afford. writing own compiler sounds heavy.

the canonical solution real problem not variable somehow query.

i'd use template user may or may not instantiate. that's quite easy discover. it's existing mechanism works in c++98, 03 11 , 14.

remember under ordinary c++ compilation model, can't query @ your compile time whether function will use variable when compiled. take time machine.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -