79281598

Date: 2024-12-14 23:59:50
Score: 1.5
Natty:
Report link

I came up with this:

 template <class T> struct var {
     using  hash_type = unsigned;
     using value_type = T;
     
     value_type value;
     const hash_type cached_id;

     constexpr var(const value_type the_value) noexcept 
      : value(the_value)
      , cached_id([]{ static hash_type k; return k++; }())
     {}

     constexpr operator auto() noexcept { return value; }
 };

 template <class T> var(T const&) -> var<T>;

Live on Compiler Explorer
No macros. Is this what you're looking for?

Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
Posted by: viraltaco_