From: Steven Watanabe (steven_at_[hidden])
Date: 2007-08-08 18:37:28


AMDG

Zach Laine <whatwasthataddress <at> gmail.com> writes:

> I didn't look too closely at the implementation, due to lack of time,
> but I would like to know why the functors in boost::range_run_storage
> are const references to singletons in an anonymous namespace. What is
> that supposed to accomplish that other techniques do not?

Just putting
namespace {
    T t;
}
in a header causes ODR violations.

The reference mechanism avoids that problem.

In Christ,
Steven Watanabe