Checked output iterator

While writing about security — which takes a great deal of my time lately, which is one of the reasons I haven’t updated my blog as often as I usually would — I came to the conclusion that, while I recommend using STL algorithms, iterators and containers for safety purposes that doesn’t solve the problem when the standard algorithms don’t check the validity of their output ranges.

So, I decided to do something about it: Microsoft Visual Studio has shipped with a checked iterator type since 2005 but turns it off by default when you’re not debugging and other compilers don’t ship with that kind of iterator — so I decided to write a simple-yet-universal iterator type that will work on most compilers, including older ones, and provide the extra safety for very little extra cost.

I’ve published it under Apache license version 2, on GitHub. I’ll be happy to merge pull requests if there’s anything you’d like to do to improve it.

About rlc

Software Analyst in embedded systems and C++, C and VHDL developer, I specialize in security, communications protocols and time synchronization, and am interested in concurrency, generic meta-programming and functional programming and their practical applications. I take a pragmatic approach to project management, focusing on the management of risk and scope. I have over two decades of experience as a software professional and a background in science.
This entry was posted in Uncategorized and tagged , . Bookmark the permalink.