Boost logo

Boost :

From: Robert Kawulak (kawulak_at_[hidden])
Date: 2007-08-30 22:11:45


> From: Neal Becker
> I want to use this like logging - where I can
> switch it off at compile time and make the overhead negligible.

I wrote a simple test function:

        int test()
        {
            bounded_int<int, -3, 7>::type b(5);
            b++;
            b -= 1;
            return b;
        }

I compiled it with gcc 4.01, optimisations turned on. I had to add explicit
'inline' to several functions, and then the assembler output was as follows:

        __Z4testv:
        LFB1019:
                pushl %ebp
        LCFI17:
                movl $5, %eax
                movl %esp, %ebp
        LCFI18:
                popl %ebp
                ret

I dare to say it couldn't be optimised more now... ;-)

Best regards,
Robert


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