compound.tpp

来自「最新的版本ACE-5.6.8,刚从外文网上搬下,与大家分享.」· TPP 代码 · 共 75 行

TPP
75
字号
// file      : Utility/ExH/Compound.tpp
// author    : Boris Kolpackov <boris@kolpackov.net>
// copyright : Copyright (c) 2002-2003 Boris Kolpackov
// license   : http://kolpackov.net/license.html

#include "Utility/ExH/Converter.hpp"

namespace Utility
{
  namespace ExH
  {
    // c-tor's & d-tor
    template <typename Type, typename Base>
    Compound<Type, Base>::
    Compound () throw ()
    {
    }

    template <typename Type, typename Base>
    Compound<Type, Base>::
    Compound (char const* description) throw ()
    {
      Base::init (description);
    }

    template <typename Type, typename Base>
    Compound<Type, Base>::
    Compound (std::string const& description) throw ()
    {
      try
      {
        Base::init (description.c_str ());
      }
      catch (...)
      {
      }
    }

    template <typename Type, typename Base>
    template <typename T>
    Compound<Type, Base>::
    Compound (T const& description) throw ()
    {
      Base::init (converter<T> (description).c_str ());
    }

    template <typename Type, typename Base>
    Compound<Type, Base>::
    Compound (Compound const& src) throw ()
          : Base::Base::Base (),
            Base::Base (),
            Base ()
    {
      Base::init (src.what ());
    }

    template <typename Type, typename Base>
    Compound<Type, Base>::
    ~Compound () throw ()
    {
    }

    // operator=

    template <typename Type, typename Base>
    Compound<Type, Base>& Compound<Type, Base>::
    operator= (Compound const& src) throw ()
    {
      Base::init (src.what ());
      return *this;
    }
  }
}
//$Id: Compound.tpp 80826 2008-03-04 14:51:23Z wotte $

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?