]> git.tdb.fi Git - r2c2.git/commitdiff
Make BeamGate compile with older GCC versions
authorMikko Rasa <tdb@tdb.fi>
Fri, 22 Nov 2013 11:21:30 +0000 (13:21 +0200)
committerMikko Rasa <tdb@tdb.fi>
Fri, 22 Nov 2013 11:21:30 +0000 (13:21 +0200)
GCC 4.6 produces ambiguity errors despite the using directive in the class
declaration.

source/libr2c2/beamgate.cpp
source/libr2c2/beamgate.h

index 698cb4595ac5fa1091993ad78842b855ee9ca0c6..463a3a967e717c78d64efa81189a05926cc88c9c 100644 (file)
@@ -13,17 +13,17 @@ BeamGate::BeamGate(Layout &l):
 {
        invert = true;
 
-       layout.add(*this);
+       TrackAttachment::layout.add(*this);
 }
 
 BeamGate::~BeamGate()
 {
-       layout.remove(*this);
+       TrackAttachment::layout.remove(*this);
 }
 
 BeamGate *BeamGate::clone(Layout *to_layout) const
 {
-       BeamGate *gate = new BeamGate(to_layout ? *to_layout : layout);
+       BeamGate *gate = new BeamGate(to_layout ? *to_layout : TrackAttachment::layout);
        gate->set_position(position);
        gate->set_rotation(rotation);
        return gate;
@@ -50,7 +50,7 @@ void BeamGate::set_rotation(const Angle &r)
 
 void BeamGate::update_attachment()
 {
-       attach_to_closest(100*layout.get_catalogue().get_gauge());
+       attach_to_closest(100*TrackAttachment::layout.get_catalogue().get_gauge());
 
        if(track)
        {
index 8a3afe404680f08875101aba407bb3f1ef30233f..bcb4f4d0f7ef9566e64430d82afe534ece3029b7 100644 (file)
@@ -20,10 +20,6 @@ public:
                void rotation(float);
        };
 
-private:
-       using TrackAttachment::layout;
-
-public:
        BeamGate(Layout &);
        virtual ~BeamGate();