Boost logo

Boost :

Subject: Re: [boost] [chrono][stopwatches] Request for interest in NEW stopwatch/timer reporting facilities
From: Steven Maitlall (m.steven_at_[hidden])
Date: 2011-09-15 09:03:36


I like the ideas you put forth here.
Though, I wonder if it could be taken a few steps further ... A boost
formatting library

 81 typedef boost::format::context_adapter<
 82 struct timeval,
 83 boost::format::context_spec<
 84 boost::format::context_element<'d', ... >
 85 > > timeval_context_t;
 86
 87 boost::format::basic_formatter<timeval_context_t> fmt;
 88
 89 struct timeval tv;
 90 gettimeofday(&tv, NULL);
 91
 92 // Standard usage
 93 std::cout << fmt("%d:%d",tv.tv_sec, tv.tv_usec) << std::endl;
 94
 95 // Output the first, then the second context elements
 96 std::cout << fmt("%{1}:%{2}",tv) << std::endl;

I like where the idea is taking me and I'm working on the implementation
details now

On Tue, Sep 13, 2011 at 6:11 PM, Vicente J. Botet Escriba <
vicente.botet_at_[hidden]> wrote:


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk