3 ms·
in practice I would probably do something more like this: typedef std::pair<std::string, std::string> TStringPair; std::vector<TStringPair> vec; or maybe:
by leetcrew 6y ago
in practice I would probably do something more like this:
typedef std::pair<std::string, std::string> TStringPair;
std::vector<TStringPair> vec;
or maybe:
typedef std::vector<std::pair<std::string, std::string>> TStringPairVec;
TStringPairVec vec;
this improves readability a bit, but is even more verbose at the declaration site if I'm not reusing the typedefs elsewhere. in an ideal world, I'd like something analogous to #undef for `using namespace` (or better yet, have this be the default at the end of a header file). this is only scratching the surface of the gotchas that come from textual inclusion.