Boost logo

Boost Users :

Subject: [Boost-users] Forward declarations and iterator_facade<>
From: Phil Endecott (spam_from_boost_users_at_[hidden])
Date: 2010-10-15 12:24:42


Dear Experts,

I have code something like this:

struct S;

class iter:
    public boost::iterator_facade<iter,S,......>
{ ... };

struct S {
    ...
};

This used to work, but stopped recently; I believe it may have been
after upgrading gcc, not after upgrading Boost itself, but I'm
uncertain about that. The problem is that something inside
iterator_facade calls boost::is_POD<S>, which (not unreasonably)
doesn't seem to work for the forward-declared S.

I've never been entirely sure what you're allowed to do with
forward-declared types like that. Was I just lucky that it worked
before, or is this a regression?

Re-ordering the code to remove the circular dependencies will be
painful, so if anyone has any other hints I would love to hear them.

Thanks, Phil.


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