This is the code:
std::string Query_Set::get_sql() const throw()
{
std::stringstream out;
int counter = 0;
out << "WHERE " << time_name << " >= :start_time_" << counter++ << " AND " << time_name << " <= :finish_time_" << counter++ " AND something_else = :" << counter++;
return out.str();
}
This code is pretty straight forward, but when I print out this String it does something weird:
"WHERE time >= :start_time_2 AND time <= :finish_time_1 AND something_else = :0"
Have I missed something simple? Why is the counter going backwards?