I wish C++ had a isMember method for its containers or a keyword like Python's "in". The most succinct way to do this currently (with vector for instance)
vector<string> naughtyList {"Bob", "Tom", "Rod", "God"};
string member = "Jerry";
for (string & each : naughtyList)
if (member == each)
// do stuff
Edit: I admit this is terrible API design. When you want the v.begin()/v.end() combination 90% of the time, why not at least have a std::find() overload that does that for you? Or simply add "std::contains(v, x) -> bool"? You can write your own version of that, of course, but... my take-home point: API design is very important.
Providing container operations as functions in <algorithm> operating on iterators means that someone implementing a new container with iterators immediately has a wealth of functionality available with no extra effort.
Also, containers that are most well suited to membership searches (std::set and std::multiset) do include find(Key const& key) as a member.
It would be nice if you resized your editor window to be as small as possible and cropped the video to that size. As it is the area of the video I actually care about is very small with lots of empty space around it.
Side note: the video player is really annoying, hitting the 'full screen' button uses the terrible full screen functionality of OS X rendering my second monitor useless.
Windows 7 Professional x64 SP1.
No video on the following 3 browsers:
Firefox 19.0.2,
Chrome 25.0.1.1364.172, and
Cyberfox 19.0.2 (a 64-bit build of Firefox).
I get video, but the audio is choppy on
IE 9.
It seems to work on my iPhone with Safari (iOS 6.1.2) but
the bandwidth required is too great for my 4G connection.
I liked your website and was going to sign up. However, your catalog of screen casts is too short to sign up for at the moment. On the other hand, does anyone know other python screen cast websites like this with more topics/videos?
vector<string> naughtyList {"Bob", "Tom", "Rod", "God"}; string member = "Jerry"; for (string & each : naughtyList) if (member == each) // do stuff
/rant