$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [Boost-users] Equality comparison of boost::function<>
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2009-08-09 18:32:11
Scott McMurray wrote:
>
> But what about this?
>
> less<int> f;
> function<bool(int,int)> g = f;
> function<bool(int,int)> h = f;
>
> Checking based on address won't be able to tell that g == h, since
> copies of f will be taken for lifetime reasons.
That's not a problem at all. Boost.function holds its content by copy.
The real issue is that function objects aren't equality comparable.
Function pointers are, but not function objects.