Boost Users :
Subject: Re: [Boost-users] boost::bind replacements
From: Littlefield, Tyler (tyler_at_[hidden])
Date: 2011-09-17 20:09:45
On 9/17/2011 1:06 PM, Dmitriy Matison wrote:
> Would you, please, tell in more detail about the overhead in binary
> size? What are approximate numbers of it? And how badly the
> compilation time decreases? I used boost::bind a lot, but haven't
> noticed that the overhead makes so much difference. Opposite example
> would be valuable.
I switched to boost::bind because I use an event system, as I pointed
out earlier. I liked being able to bind to methods and static members,
rather than just global functions with a function pointer. The overhead
could very well be with boost::function, since every time I add a
typedef I get a lot of overhead there.
I can't rip it out and show exactly how much compilation time decreases
because it's an integral part of my system now. I don't think the
compilation time has went up by a huge factor, but the binary size
certainly has. This is both with -O3 and -O0, using g++.
> On 17 September 2011 21:46, Littlefield, Tyler<tyler_at_[hidden]> wrote:
>> Hello all:
>> I really like boost::bind because I use an event system in my game engine,
>> and it allows me to bind callbacks in classes, rather than having everything
>> as global functions, like they were before.
>> My problem is this. Boost::bind incurs a lot of overhead, both during
>> compilation and in binary size. Is there any way to decrease this? If not,
>> I'm curious if someone could explain how boost::bind works so that I can
>> create my own?
>> I understand function objects can hold function pointers and boost::bind
>> returns a function object, but I'm really confused as to how placeholders
>> Take care,
>> Web: http://tds-solutions.net
>> The Aspen project: a light-weight barebones mud engine
>> Sent from my toaster.
>> Boost-users mailing list
> Boost-users mailing list
-- Take care, Ty Web: http://tds-solutions.net The Aspen project: a light-weight barebones mud engine http://code.google.com/p/aspenmud Sent from my toaster.
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