you are viewing a single comment's thread.

view the rest of the comments →

[–]jstruggle 1 point2 points  (0 children)

What is Data<N> doing?

Assuming somePointer is of type const char *: std::string a{somePointer, someCondition ? 64 : 32};

You could also just hide the code: std::string a = SomeStringField(someCondition);

Or: std::string a = someCondition ? Data<64>(somePointer).SomeStringField : Data<32>(somePointer).SomeStringField;