Yes. I've often been helping with code bases of hundreds of
thousands of lines and so it is non-issue for my subjective taste.
C++ is verbose, I use it not because it is terse. Some C-like
languages like Swift are way more laconic but these have their
own issues.
Program is put together of patterns and it is business of compiler
to reduce it to minimal binary code.
> Perhaps it's better to say I think it makes
> people prefer std::set to std::unordered set, especially for
> short-lived containers which maybe just help eliminate duplicates from
> a sequence. And maybe use std::strings as keys rather than their own
> types.
May be it is indeed better to use unordered_map<std::string, Photo>.
I think of such idiom as "dictionary idiom" as it is rather common.
That does compile when <string> is included. What you search
for photo in your set of photos with? Without file name in
external interface? Dummy photo?
> As you can tell, it's a bit frustrating to me that the better
> containers (when you don't need ordering etc) mean more work.
>
> But, at least it seems I haven't missed some nice shortcut that
> everyone else uses.
I have not felt like that is issue. Most searchable containers
I use are sorted vectors, hash-table based containers or
Boost.Intrusives. Sometimes I use my own implementation of
sorted deque (as std::deque does not let to specify block sizes).
The std::set or std::map I avoid because these either lose in
performance or lack characteristics that I need.
For example Boost.Intrusive sets are way more verbose than
std::sets to handle as these do not own the elements but when
used correctly then have great qualities that nothing else provides.
For example it is possible to have polymorphic objects in those
very efficiently, similarly to boost::poly_collection::base_collection.
Consider std::set<unique_ptr<Base>> ... boost::intrusive::set just
wipes floors with it in every benchmark.