Welcome to the most active Linux Forum on the web.
Go Back > Blogs
User Name



An Experiment: From C Definitions To Templates

Posted 05-02-2015 at 09:22 PM by rainbowsally
Updated 05-03-2015 at 11:13 PM by rainbowsally (additions and corrections, description mod)

An Experiment: From C Definitions To Templates

This is a tangent, but a forgivable one, no?

Today's mind-blowing Mad Computer Science features:
  • An experiment morphing a regular old C style set of functions into a set of C++ templates.
  • We rename a literal parameter type to a template parameter T and voila!
  • This will help demystify the horrible noise in the messy STL templates by making a simple transition from main_1 to main_2, in which error messages from the compiler
Posted in Uncategorized
Views 800 Comments 0 rainbowsally is offline

STL Template Experiment (Lists)

Posted 12-24-2012 at 10:24 AM by rainbowsally
Updated 08-06-2014 at 09:00 AM by rainbowsally (added link, grammar error, makefile line correction)

We've resurrected some dead code that was pretty ugly but the only worse MESS (officially sanctioned, no less) than STL that we've ever seen is the spaghetti in lex/flex output. -- The Computer Mad Science Dept.


Now what?


...what would ANY good Computer Mad Scientist do in a situation like this?

Today's features are
  • Creating lists using the std::list STL template.
  • Identifying the critical 'operators'
Posted in Uncategorized
Views 2022 Comments 1 rainbowsally is offline

An STL Template Experiment

Posted 12-18-2012 at 05:05 PM by rainbowsally

Today's features:
  • Getting an address of an iterator from stl.
  • Creating a foreach() macro.
  • A couple of ways to work around unwanted C++ compiler warnings.

STL is a freaking nighmare to trace in a debugger so it's not too easy to tell what goes on in them but one thing became quite clear and that is that iterators are generic pointer types internally, which makes sense since STL needs to deal with so many different types.

Here's a little test to play with to show how...
Posted in Uncategorized
Views 1058 Comments 0 rainbowsally is offline


All times are GMT -5. The time now is 01:11 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration