Boost logo

Boost Users :

Subject: Re: [Boost-users] An example: how I learned to iterate through property trees (ptree)
From: Bjorn Reese (breese_at_[hidden])
Date: 2013-06-22 04:11:22


On 06/21/2013 06:24 PM, Cook, Rich wrote:

> string indent(int level) {
> string s;
> for (int i=0; i<level; i++) s += " ";
> return s;
> }

A more efficient way:

   const int indentStep = 2;

   string indent(int level) {
     return string(level * indentStep, ' ');
   }


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net