Problem with noncopyable in current cvs

/usr/local/src/boost.cvs/boost/noncopyable.hpp:32: error: conflicting types for `typedef class boost::noncopyable_::noncopyable boost::noncopyable' /usr/local/src/boost.cvs/boost/utility_fwd.hpp:26: error: previous declaration as `struct boost::noncopyable'

"Neal D. Becker" <ndbecker2@verizon.net> writes:
/usr/local/src/boost.cvs/boost/noncopyable.hpp:32: error: conflicting types for `typedef class boost::noncopyable_::noncopyable boost::noncopyable' /usr/local/src/boost.cvs/boost/utility_fwd.hpp:26: error: previous declaration as `struct boost::noncopyable'
Should be fixed now. Sorry! -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams writes:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
/usr/local/src/boost.cvs/boost/noncopyable.hpp:32: error: conflicting types for `typedef class boost::noncopyable_::noncopyable boost::noncopyable' /usr/local/src/boost.cvs/boost/utility_fwd.hpp:26: error: previous declaration as `struct boost::noncopyable'
Should be fixed now.
It wasn't. I removed the forward declaration from "utility_fwd.hpp" as useless and wrongly placed. As a matter of fact, IMO the header itself is ill-advised and should be removed. Objections? -- Aleksey Gurtovoy MetaCommunications Engineering

Aleksey Gurtovoy <agurtovoy@meta-comm.com> writes:
David Abrahams writes:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
/usr/local/src/boost.cvs/boost/noncopyable.hpp:32: error: conflicting types for `typedef class boost::noncopyable_::noncopyable boost::noncopyable' /usr/local/src/boost.cvs/boost/utility_fwd.hpp:26: error: previous declaration as `struct boost::noncopyable'
Should be fixed now.
It wasn't.
The checkin failed because of your simultaneous change below and I didn't notice.
I removed the forward declaration from "utility_fwd.hpp" as useless and wrongly placed.
It is not useless!
As a matter of fact, IMO the header itself is ill-advised and should be removed. Objections?
Yes! I use noncopyable as a DSL template parameter in Boost.Python and all I need is a declaration. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

"Peter Dimov" <pdimov@mmltd.net> writes:
David Abrahams wrote:
I use noncopyable as a DSL template parameter in Boost.Python and all I need is a declaration.
And you consider #include <boost/utility_fwd.hpp> a win over #include <boost/noncopyable.hpp>?
Maybe not; I think utility_fwd appeared before noncopyable was factored into a separate header from other utility stuff. I guess I'm willing to have it killed if all the references are updated. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams writes:
Aleksey Gurtovoy <agurtovoy@meta-comm.com> writes:
David Abrahams writes:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
/usr/local/src/boost.cvs/boost/noncopyable.hpp:32: error: conflicting types for `typedef class boost::noncopyable_::noncopyable boost::noncopyable' /usr/local/src/boost.cvs/boost/utility_fwd.hpp:26: error: previous declaration as `struct boost::noncopyable'
Should be fixed now.
It wasn't.
The checkin failed because of your simultaneous change below and I didn't notice.
If it failed, it was for some other reason. I checked in the fix 6 hours after your mail.
I removed the forward declaration from "utility_fwd.hpp" as useless and wrongly placed.
It is not useless!
Pretty much, IMO.
As a matter of fact, IMO the header itself is ill-advised and should be removed. Objections?
Yes!
I use noncopyable as a DSL template parameter in Boost.Python and all I need is a declaration.
Given the size of the class, I think it's a misguided desire. -- Aleksey Gurtovoy MetaCommunications Engineering

Aleksey Gurtovoy <agurtovoy@meta-comm.com> writes:
As a matter of fact, IMO the header itself is ill-advised and should be removed. Objections?
Yes!
I use noncopyable as a DSL template parameter in Boost.Python and all I need is a declaration.
Given the size of the class, I think it's a misguided desire.
Okay I agree. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

Hi Dave, Your latest changes to noncopyable (putting it into namespace noncopyable_) seem to break a lot of boost code, since class noncopyable now no longer exists in namespace boost. Matthias

Matthias Troyer <troyer@itp.phys.ethz.ch> writes:
Hi Dave,
Your latest changes to noncopyable (putting it into namespace noncopyable_) seem to break a lot of boost code, since class noncopyable now no longer exists in namespace boost.
It should be better now. The original problem, as Aleksey suggested, was utility_fwd.hpp, which as a matter of fact I was *not* using. I just removed the noncopyable forward declaration and typedef from it and put it all in noncopyable.hpp. Sorry for the churn, everybody. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

David Abrahams wrote:
It should be better now. The original problem, as Aleksey suggested, was utility_fwd.hpp, which as a matter of fact I was *not* using. I just removed the noncopyable forward declaration and typedef from it and put it all in noncopyable.hpp.
anonymous CVS is deferred or your fix is incomplete. Feel free to throw away fixes I just sent in another thread if you think it's unnedded :) B.

Bronek Kozicki <brok@rubikon.pl> writes:
David Abrahams wrote:
It should be better now. The original problem, as Aleksey suggested, was utility_fwd.hpp, which as a matter of fact I was *not* using. I just removed the noncopyable forward declaration and typedef from it and put it all in noncopyable.hpp.
anonymous CVS is deferred
It always is.
or your fix is incomplete.
What's the problem?
Feel free to throw away fixes I just sent in another thread if you think it's unnedded :)
Sorry, I didn't see any. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

[Top-post since the new stuff gives a fuller context.] I think I need to explain things. (This is what I get for not reading Boost e-mail for a few days. I could have nipped this in the bud. I didn't find out about this problem myself until I tried a compile....) 1. <boost/utility_fwd.hpp> was introduced with <boost/utility/base_from_member.hpp> 1a. <boost/utility/base_from_member.hpp> #includes <boost/utility_fwd.hpp>, and needs to since a template value default is in the forwarding header. 2. The other forward-able items in <boost/utility.hpp> were added to <boost/utility_fwd.hpp> upon first commit. 3. The various items in <boost/utility.hpp> were split into several headers. 4. The maintainers of <boost/noncopyable.hpp>, then _and_ now, ignored the fact that <boost/utility_fwd.hpp> referenced boost::noncopyable. This was the mistake. 5. What should have happened was to add "#include <boost/utility_fwd.hpp>" to <boost/noncopyable.hpp> at the time of the split. 6. The reason for [5]? Headers that have a corresponding forwarding header should always #include that forwarding header. Why? So... 7. If someone makes a significant change in the primary header, the mismatch in the forwarding header will cause a compile-time error. (If only we caught the mistake at [4], then Dave's change would have been flagged, and we could have avoided this incident.) 8. Unfortunately, Dave and Aleksey didn't understand this and went the other way. Instead of adding "#include <boost/utility_fwd.hpp>" to <boost/noncopyable.hpp> (Bronek Kozicki suggested this), they excised boost::noncopyable from <boost/utility_fwd.hpp>. So, can we make the change go the other way? On 8/20/04 2:18 PM, "David Abrahams" <dave@boost-consulting.com> wrote:
Matthias Troyer <troyer@itp.phys.ethz.ch> writes:
Your latest changes to noncopyable (putting it into namespace noncopyable_) seem to break a lot of boost code, since class noncopyable now no longer exists in namespace boost.
It should be better now. The original problem, as Aleksey suggested, was utility_fwd.hpp, which as a matter of fact I was *not* using. I just removed the noncopyable forward declaration and typedef from it and put it all in noncopyable.hpp.
Sorry for the churn, everybody.
-- Daryle Walker Mac, Internet, and Video Game Junkie darylew AT hotmail DOT com

Daryle Walker <darylew@hotmail.com> writes:
[Top-post since the new stuff gives a fuller context.]
I think I need to explain things. (This is what I get for not reading Boost e-mail for a few days. I could have nipped this in the bud. I didn't find out about this problem myself until I tried a compile....)
1. <boost/utility_fwd.hpp> was introduced with <boost/utility/base_from_member.hpp>
_That_ was the first mistake.
1a. <boost/utility/base_from_member.hpp> #includes <boost/utility_fwd.hpp>, and needs to since a template value default is in the forwarding header.
It should have included boost/utility/base_from_member_fwd.hpp, if anything.
2. The other forward-able items in <boost/utility.hpp> were added to <boost/utility_fwd.hpp> upon first commit.
Unneccessary. boost/utility.hpp is an obsolete construct; it's just there for backward compatibility.
3. The various items in <boost/utility.hpp> were split into several headers.
4. The maintainers of <boost/noncopyable.hpp>, then _and_ now, ignored the fact that <boost/utility_fwd.hpp> referenced boost::noncopyable. This was the mistake.
5. What should have happened was to add "#include <boost/utility_fwd.hpp>" to <boost/noncopyable.hpp> at the time of the split.
Not doing that was the second mistake.
6. The reason for [5]? Headers that have a corresponding forwarding header should always #include that forwarding header. Why? So...
Yes, but noncopyable.hpp shouldn't have a forwarding header.
7. If someone makes a significant change in the primary header, the mismatch in the forwarding header will cause a compile-time error. (If only we caught the mistake at [4], then Dave's change would have been flagged, and we could have avoided this incident.)
8. Unfortunately, Dave and Aleksey didn't understand this and went the other way. Instead of adding "#include <boost/utility_fwd.hpp>" to <boost/noncopyable.hpp> (Bronek Kozicki suggested this), they excised boost::noncopyable from <boost/utility_fwd.hpp>.
So, can we make the change go the other way?
No way, man. Some people already argue against noncopyable on the grounds that it introduces too many dependencies. -- Dave Abrahams Boost Consulting http://www.boost-consulting.com

Aleksey Gurtovoy wrote:
David Abrahams writes:
"Neal D. Becker" <ndbecker2@verizon.net> writes:
/usr/local/src/boost.cvs/boost/noncopyable.hpp:32: error: conflicting types for `typedef class boost::noncopyable_::noncopyable boost::noncopyable' /usr/local/src/boost.cvs/boost/utility_fwd.hpp:26: error: previous declaration as `struct boost::noncopyable'
Should be fixed now.
It wasn't. I removed the forward declaration from "utility_fwd.hpp" as useless and wrongly placed. As a matter of fact, IMO the header itself is ill-advised and should be removed.
As is boost::noncopyable itself. ;-)

"Peter Dimov" <pdimov@mmltd.net> writes:
As is boost::noncopyable itself. ;-)
Aw, c'mon; it's a trade-off. You gain some self-documenting power, save some typing, eliminate the possibility of certain errors. You lose EBO and add minor coupling. Anything I missed? -- Dave Abrahams Boost Consulting http://www.boost-consulting.com
participants (8)
-
Aleksey Gurtovoy
-
Bronek Kozicki
-
Daryle Walker
-
David Abrahams
-
Matthias Troyer
-
Neal D. Becker
-
Peter Dimov
-
Steven E. Harris