Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 1318

Comment by HolyBlackCat on How can I initialize a random struct type using the template function?

$
0
0
This is a problem specifically with array members. Just don't use them, use std::array (or better std::string in this case, as NathanOliver suggests below). Also I recommend using (...) instead of {...}, because the latter can break in weird ways e.g. for standard containers. And the former works for structs without custom constructors since C++20.

Viewing all articles
Browse latest Browse all 1318

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>