Ignore:
Timestamp:
Mar 19, 2011, 9:13:12 PM (13 years ago)
Author:
イグトランス (egtra)
Message:

ab_commonにおいて、各クラスのコピー禁止を明確化、ならびにコピー可能なものにムーブコンストラクタ・ムーブ代入演算子を追加

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/egtra/ab5.0/abdev/ab_common/include/Lexical/Source.h

    r810 r816  
    103103        text.buffer = static_cast<char*>(calloc(1, 1));
    104104        text.length = 0;
     105    }
     106    Text& operator =(Text&& y)
     107    {
     108        SwapImpl(*this, y);
     109        return *this;
     110    }
     111    Text& operator =(Text const& y)
     112    {
     113        return *this = std::move(Text(y));
    105114    }
    106115    ~Text(){
     
    309318        ar & boost::serialization::make_nvp("vector_BasicSource", boost::serialization::base_object<std::vector<BasicSource>>(*this));
    310319    }
     320
     321public:
     322    BasicSources() {}
     323    BasicSources(BasicSources&& y) : std::vector<BasicSource>(std::move(y)) {}
     324    BasicSources(BasicSources const& y) : std::vector<BasicSource>(y) {}
     325    BasicSources operator =(BasicSources&& y)
     326    {
     327        std::vector<BasicSource>::operator =(std::move(y));
     328        return *this;
     329    }
     330    BasicSources operator =(BasicSources const& y)
     331    {
     332        return *this = std::move(BasicSources(y));
     333    }
    311334};
    312335
     
    336359    {
    337360    }
     361    SourceCodePosition(SourceCodePosition const& y)
     362        : relationalObjectModuleIndex(y.relationalObjectModuleIndex)
     363        , pos(y.pos)
     364    {
     365    }
     366
     367    SourceCodePosition& operator =(SourceCodePosition const& y)
     368    {
     369        relationalObjectModuleIndex = y.relationalObjectModuleIndex;
     370        pos = y.pos;
     371        return *this;
     372    }
    338373
    339374    int GetRelationalObjectModuleIndex() const;
Note: See TracChangeset for help on using the changeset viewer.