
On Sun, Jul 19, 2009 at 7:12 PM, Edward Grace<ej.grace@imperial.ac.uk> wrote:
And yea yea, I would like to use GCC to compile, but I currently have sold my soul to the Visual Assist plugin for Visual Studio. If any IDE
IDE? Whassat? What's wrong with........
....emacs? ;-)
Heh, believe me, it does no where near. Visual Assist parses out the files, it know what are macros, templates, everything, it guesses most of the code that I am writing for me, it literally puts in probably 80% of what I type, it is intelligent and very well made (once you know how it thinks). Emacs could never compare as-is. Believe me, once you use it for a month, you would be addicted. Most, if not all major programming companies use it. :p On Sun, Jul 19, 2009 at 7:12 PM, Edward Grace<ej.grace@imperial.ac.uk> wrote:
(back on topic now)
Sorry for the noise, but the only error I could not get rid of with single-line edits to your files is:
1>R:\Programming_Projects\Spirit_Price\ejg_uint_parser_timing\other_includes\ejg/timer.cpp(117) : error C2676: binary '-' : 'ticks' does not define this operator or a conversion to a type acceptable to the predefined operator
The while statement?
chrono_start = chrono(); while (chrono_wall()-chrono_wall_start < chrono_wall_scale*4); chrono_end = chrono();
Hmm. Depending on what the type of 'ticks' from cycle.h is (that's what you're using right) that should just be a large integer type. Perhaps try with the util::high_resolution_timer, which is of type double(). According to Visual Assist, ticks is of type LARGE_INTEGER, a union type with 4 parts and a max size of 64-bits, it has no operator- defined, hence you would need to reference an internal part, it looks
Er, yes, right... On Sun, Jul 19, 2009 at 7:10 PM, Edward Grace<ej.grace@imperial.ac.uk> wrote: like QuadPart (like chrono_wall().QuadPart) would work, but that does not fit into your design. I added this to the proper place in the cycle.h file: LARGE_INTEGER operator-(LARGE_INTEGER l, LARGE_INTEGER r) { LARGE_INTEGER res; res.QuadPart = l.QuadPart - r.QuadPart; return res; } Now it says: 1>R:\Programming_Projects\Spirit_Price\ejg_uint_parser_timing\other_includes\ejg/timer.cpp(117) : error C2440: '<function-style-cast>' : cannot convert from 'LARGE_INTEGER' to 'double' 1> No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1> R:\Programming_Projects\Spirit_Price\ejg_uint_parser_timing\other_includes\ejg/timer.cpp(109) : while compiling class template member function 'void ejg::generic_timer<ticks>::calibrate_seconds(void)' 1> with 1> [ 1> ticks=ticks 1> ] 1> .\ejg_uint_parser.cpp(133) : see reference to class template instantiation 'ejg::generic_timer<ticks>' being compiled 1> with 1> [ 1> ticks=ticks 1> ] 1>R:\Programming_Projects\Spirit_Price\ejg_uint_parser_timing\other_includes\ejg/timer.cpp(239) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data 1> .\ejg_uint_parser.cpp(154) : see reference to function template instantiation 'void ejg::generic_timer<ticks>::measure_percentage_speedup<void(__cdecl *)(void),void(__cdecl *)(void)>(_OperationA,_OperationB,double &,double &,double &)' being compiled 1> with 1> [ 1> ticks=ticks, 1> _OperationA=void (__cdecl *)(void), 1> _OperationB=void (__cdecl *)(void) 1> ] 1>R:\Programming_Projects\Spirit_Price\ejg_uint_parser_timing\other_includes\ejg/timer.cpp(246) : warning C4267: '=' : conversion from 'size_t' to 'unsigned int', possible loss of data So the union has no conversion to double, of course. Trying What do you want me to do with util::high_resolution_timer? On Sun, Jul 19, 2009 at 7:10 PM, Edward Grace<ej.grace@imperial.ac.uk> wrote:
Otherwise do you think the compiler is getting confused between the name of the template parameter 'ticks' and the type 'ticks'?
Hmm, do not know, I never duplicate names like that so have not run into that... On Sun, Jul 19, 2009 at 9:51 PM, Joel de Guzman<joel@boost-consulting.com> wrote:
Edward, just a compliment (for now): what you are doing is cool! I'm starting to be an eager supporter.
I have to say that I like the design of your timer library as well, looks to be very useful. :)