Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2006-01-27 11:50:51


Cromwell Enage <sponage_at_[hidden]> writes:

> MinGW reports:
> 'static const T&
> boost::random::detail::ptr_helper<T&>::ref(const T&)
> [with T = const boost::mt19937]' and 'static T&
> boost::random::detail::ptr_helper<T&>::ref(T&) [with T
> = const boost::mt19937]' cannot be overloaded
>
> When I wrap boost::ref around rng, the program runs
> fine.
>
> I'm curious as to why I get this error only when
> specifying positional arguments. Have I run afoul of
> something fundamental, such as the forwarding problem?

I take it back; I'm pretty sure this has nothing to do with
forwarding. On what line of *your code* does that error appear? I
bet it actually appears in the random library. Thus, I bet this has
nothing whatever to do with the parameter library.

I suggest you reduce your problem to the minimal example that
reproduces the problem. But first I suggest you make rng const in
main and see what happens. I bet you get the same error. Remember,
positional arguments are passed by const& unless you use ref().

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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