Monthly Archives: December 2009

À la STL find_range()

I started by writing some code for the typical interviewee question and ended up factoring out part of it in a function I called find_range: template <typename BidirectionalIterator_t, typename Predicate_t> pair<BidirectionalIterator_t, BidirectionalIterator_t> find_range(BidirectionalIterator_t first,                                                                   BidirectionalIterator_t last,                                                                   Predicate_t             predicate) {    first … Continue reading

Posted in Computers and Internet | Leave a comment

auto keyword as platform porting helper?

Do you see anything wrong with this code? vector<int> v; // … int l = v.size();   Well, it seems that a lot of ISV’s don’t as I’ve encountered it many times. If you compile for 32-bit at warning level … Continue reading

Posted in Computers and Internet | Leave a comment

decltype() as a documentating helper…

I just realized that since I’m using VC++ 2010 Beta 2 and thus, can enjoy some of the C++ 0x features, I tend to often use the decltype for documentation reason, not just in template code. “How come?”, I hear … Continue reading

Posted in Computers and Internet | Leave a comment