79099726

Date: 2024-10-17 20:26:21
Score: 1
Natty:
Report link

using Jarod42s "old way", I ended here

template<class T, int X>
struct B {
  B(const T&) { cout << "X=" << X << "\n"; }
};

template <int N, class T> B<T, N> make_B(const T& t) { return B<T, N>(t); }
#define MAKE_B(obj, val) make_B<val>(obj)

...

B b2 =MAKE_B("Whatever", 42);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: albert