• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ self_type类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中self_type的典型用法代码示例。如果您正苦于以下问题:C++ self_type类的具体用法?C++ self_type怎么用?C++ self_type使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了self_type类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: PointSet

 PointSet( const self_type& P )
     :
     super(),
     M_npoints( P.nPoints() ),
     M_points( P.points() ),
     M_points_face( P.M_points_face )
 {}
开发者ID:TrojanXu,项目名称:feelpp,代码行数:7,代码来源:pointset.hpp


示例2: inherit

    void inherit( self_type & parent ) {
#ifdef DEBUGGING
        assert( parent.size() <= size() );
#endif  // DEBUGGING

        memcpy( m_positions, parent.m_positions, parent.size() * sizeof(position_type) );
    }
开发者ID:putnampp,项目名称:clotho,代码行数:7,代码来源:base_allele.hpp


示例3: switch

    inline void basic_val<T>::copy(self_type const& o)
    {
        if (type() == o.type())
        {
            switch (o.type())
            {
                case type_info::object:
                    o_ = o.o_;
                    break;
                case type_info::array:
                    a_ = o.a_;
                    break;
                case type_info::string:
                    s_ = o.s_;
                    break;
                case type_info::int_:
                    i_ = o.i_;
                    break;
                case type_info::double_:
                    d_ = o.d_;
                    break;
                case type_info::bool_:
                    b_ = o.b_;
                    break;
                default:
                    break;
            }
            return;
        }

        free();

        switch (type_ = o.type())
        {
            case type_info::object:
                new (&o_) object(o.o_);
                break;
            case type_info::array:
                new (&a_) array(o.a_);
                break;
            case type_info::string:
                new (&s_) string(o.s_);
                break;
            case type_info::int_:
                i_ = o.i_;
                break;
            case type_info::double_:
                d_ = o.d_;
                break;
            case type_info::bool_:
                b_ = o.b_;
                break;
            default:
                break;
        }
    }
开发者ID:metagoto,项目名称:vrac0x,代码行数:56,代码来源:basic_val.hpp


示例4: AllocFailed

void
nsTString_CharT::ReplaceSubstring(const self_type& aTarget,
                                  const self_type& aNewValue)
{
  if (!ReplaceSubstring(aTarget, aNewValue, mozilla::fallible)) {
    // Note that this may wildly underestimate the allocation that failed, as
    // we could have been replacing multiple copies of aTarget.
    AllocFailed(mLength + (aNewValue.Length() - aTarget.Length()));
  }
}
开发者ID:MekliCZ,项目名称:positron,代码行数:10,代码来源:nsTStringObsolete.cpp


示例5: BeginReading

int32_t
nsACString::RFind(const self_type& aStr, int32_t aOffset,
                  ComparatorFunc aComparator) const
{
  const char_type* begin;
  const char_type* end;
  uint32_t selflen = BeginReading(&begin, &end);

  const char_type* other;
  uint32_t otherlen = aStr.BeginReading(&other);

  if (selflen < otherlen) {
    return -1;
  }

  if (aOffset < 0 || uint32_t(aOffset) > (selflen - otherlen)) {
    end -= otherlen;
  } else {
    end = begin + aOffset;
  }

  for (const char_type* cur = end; cur >= begin; --cur) {
    if (!aComparator(cur, other, otherlen)) {
      return cur - begin;
    }
  }
  return -1;
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:28,代码来源:nsStringAPI.cpp


示例6: cross

 self_type cross(self_type const& r) const
 {
     impl_type* pl = (impl_type*)this->data();
     impl_type const* pr = (impl_type const*)r.data();
     impl_type res = pl->cross(*pr);
     return self_type(res(0), res(1), res(2));
 }
开发者ID:,项目名称:,代码行数:7,代码来源:


示例7:

void
nsTSubstring_CharT::Assign(const self_type& aStr)
{
  if (!Assign(aStr, fallible_t())) {
    NS_ABORT_OOM(aStr.Length());
  }
}
开发者ID:Andrel322,项目名称:gecko-dev,代码行数:7,代码来源:nsTSubstring.cpp


示例8: BeginReading

int32_t
nsACString::Find(const self_type& aStr, uint32_t aOffset,
                 ComparatorFunc c) const
{
  const char_type *begin, *end;
  uint32_t selflen = BeginReading(&begin, &end);

  if (aOffset > selflen)
    return -1;

  const char_type *other;
  uint32_t otherlen = aStr.BeginReading(&other);

  if (otherlen > selflen - aOffset)
    return -1;

  // We want to stop searching otherlen characters before the end of the string
  end -= otherlen;

  for (const char_type *cur = begin + aOffset; cur <= end; ++cur) {
    if (!c(cur, other, otherlen))
      return cur - begin;
  }
  return -1;
}
开发者ID:mikeaich,项目名称:releases-mozilla-central,代码行数:25,代码来源:nsStringAPI.cpp


示例9: push_back

    void push_back( self_type & other, size_t idx ) {
        size_t e = this->m_positions.size();

        this->resize( e + 1 );

        this->setPositionAt( e, other.getPositionAt( idx ) );
    }
开发者ID:putnampp,项目名称:clotho,代码行数:7,代码来源:base_allele.hpp


示例10: AllocFailed

void
nsTSubstring_CharT::Assign(const self_type& aStr)
{
  if (!Assign(aStr, fallible_t())) {
    AllocFailed(aStr.Length());
  }
}
开发者ID:ashishrana7,项目名称:firefox,代码行数:7,代码来源:nsTSubstring.cpp


示例11: while

void
nsTString_CharT::ReplaceSubstring( const self_type& aTarget, const self_type& aNewValue )
  {
    if (aTarget.Length() == 0)
      return;

    uint32_t i = 0;
    while (i < mLength)
      {
        int32_t r = FindSubstring(mData + i, mLength - i, aTarget.Data(), aTarget.Length(), false);
        if (r == kNotFound)
          break;

        Replace(i + r, aTarget.Length(), aNewValue);
        i += r + aNewValue.Length();
      }
  }
开发者ID:jonathanmarvens,项目名称:mozilla-central,代码行数:17,代码来源:nsTStringObsolete.cpp


示例12: if

bool
nsTSubstring_CharT::Assign( const self_type& str, const fallible_t& )
  {
    // |str| could be sharable.  we need to check its flags to know how to
    // deal with it.

    if (&str == this)
      return true;

    if (!str.mLength)
      {
        Truncate();
        mFlags |= str.mFlags & F_VOIDED;
        return true;
      }

    if (str.mFlags & F_SHARED)
      {
        // nice! we can avoid a string copy :-)

        // |str| should be null-terminated
        NS_ASSERTION(str.mFlags & F_TERMINATED, "shared, but not terminated");

        ::ReleaseData(mData, mFlags);

        mData = str.mData;
        mLength = str.mLength;
        SetDataFlags(F_TERMINATED | F_SHARED);

        // get an owning reference to the mData
        nsStringBuffer::FromData(mData)->AddRef();
        return true;
      }
    else if (str.mFlags & F_LITERAL)
      {
        NS_ABORT_IF_FALSE(str.mFlags & F_TERMINATED, "Unterminated literal");

        AssignLiteral(str.mData, str.mLength);
        return true;
      }

    // else, treat this like an ordinary assignment.
    return Assign(str.Data(), str.Length(), fallible_t());
  }
开发者ID:,项目名称:,代码行数:44,代码来源:


示例13: equal

 bool equal(const self_type& rhs) const
 {
     if (valid_)
     {
         if (rhs.valid_)
             return this->base() == rhs.base();
         else
             return false;
     }
     else
         return !rhs.valid_;
 }
开发者ID:fpelliccioni,项目名称:hamigaki,代码行数:12,代码来源:optional_iterator.hpp


示例14: BeginReading

PRInt32 
nsACString::RFind(const self_type& aStr, PRInt32 aOffset, ComparatorFunc c) const
{
  const char_type *begin, *end;
  PRUint32 selflen = BeginReading(&begin, &end);

  const char_type *other;
  PRUint32 otherlen = aStr.BeginReading(&other);

  if (selflen < otherlen)
    return -1;

  if (aOffset < 0 || aOffset > (selflen - otherlen))
    end -= otherlen;
  else
    end = begin + aOffset;

  for (const char_type *cur = end; cur >= begin; --cur) {
    if (!c(cur, other, otherlen))
      return cur - begin;
  }
  return -1;
}
开发者ID:fortunto2,项目名称:celtx,代码行数:23,代码来源:nsStringAPI.cpp


示例15: hash_value

 friend inline std::size_t hash_value(self_type const& x) {
   std::size_t h = boost::hash<MatchState>()(x.match);
   boost::hash_combine(h, x.input);
   x.hashCombine(h);
   return h;
 }
开发者ID:sdl-research,项目名称:hyp,代码行数:6,代码来源:Compose.hpp


示例16: vector_range

 vector_range(self_type const & v, range const & entry_range)
   : base_type(const_cast<handle_type &>(v.handle()),
               entry_range.size(), v.start() + v.stride() * entry_range.start(), v.stride()) {}
开发者ID:andiselinger,项目名称:viennacl-dev,代码行数:3,代码来源:vector_proxy.hpp


示例17: print

 friend inline void print(O& o, derivation_type const& d, self_type const& s) {
   s.print_projection(o, d);
 }
开发者ID:zjucsxxd,项目名称:carmel,代码行数:3,代码来源:lazy_forest_kbest.hpp


示例18: fwd_aptr

inline actor_ptr fwd_aptr(const self_type& s) {
    return s.unchecked();
}
开发者ID:qiutaoleo,项目名称:libcppa,代码行数:3,代码来源:logging.hpp


示例19:

 bool operator>= (self_type rhs ) const { return internal_id >= rhs.get(); }
开发者ID:masteroftime,项目名称:viennagrid-dev,代码行数:1,代码来源:id.hpp


示例20: _

 static inline actor_ptr _(const self_type& s) { return s.get(); }
开发者ID:Hegen,项目名称:libcppa,代码行数:1,代码来源:scheduler.hpp



注:本文中的self_type类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ semaphore类代码示例发布时间:2022-05-31
下一篇:
C++ select_support_type类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap