From 2615896faa646e5830abf2c269150e1165c66515 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Fri, 18 Dec 2020 18:48:46 +0300 Subject: Switch to build2 --- libxsd/xsd/cxx/tree/containers.txx | 295 ------------------------------------- 1 file changed, 295 deletions(-) delete mode 100644 libxsd/xsd/cxx/tree/containers.txx (limited to 'libxsd/xsd/cxx/tree/containers.txx') diff --git a/libxsd/xsd/cxx/tree/containers.txx b/libxsd/xsd/cxx/tree/containers.txx deleted file mode 100644 index 11f52a1..0000000 --- a/libxsd/xsd/cxx/tree/containers.txx +++ /dev/null @@ -1,295 +0,0 @@ -// file : xsd/cxx/tree/containers.txx -// license : GNU GPL v2 + exceptions; see accompanying LICENSE file - -#include - -#ifdef XSD_CXX11 -# include // std::move -#endif - -#include - -namespace xsd -{ - namespace cxx - { - namespace tree - { - // one - // - template - one:: - ~one () - { - delete x_; - } - - template - one:: - one (container* c) - : x_ (0), container_ (c) - { - } - - template - one:: - one (const T& x, container* c) - : x_ (0), container_ (c) - { - set (x); - } - - template - one:: - one (XSD_AUTO_PTR x, container* c) - : x_ (0), container_ (c) - { -#ifdef XSD_CXX11 - set (std::move (x)); -#else - set (x); -#endif - } - - template - one:: - one (const one& x, flags f, container* c) - : x_ (0), container_ (c) - { - if (x.present ()) - set (x.get (), f); - } - - template - one& one:: - operator= (const one& x) - { - if (this == &x) - return *this; - - if (x.present ()) - set (x.get ()); - else - { - delete x_; - x_ = 0; - } - - return *this; - } - - template - void one:: - set (const T& x, flags f) - { - // We always do a fresh copy because T may not be x's - // dynamic type. - // - T* r (x._clone (f, container_)); - - delete x_; - x_ = r; - } - - template - void one:: - set (XSD_AUTO_PTR x) - { - T* r (0); - - if (x.get () != 0) - { - if (x->_container () != container_) - x->_container (container_); - - r = x.release (); - } - - delete x_; - x_ = r; - } - - // optional - // - template - optional:: - ~optional () - { - delete x_; - } - - template - optional:: - optional (container* c) - : x_ (0), container_ (c) - { - } - - template - optional:: - optional (const T& x, container* c) - : x_ (0), container_ (c) - { - set (x); - } - - template - optional:: - optional (XSD_AUTO_PTR x, container* c) - : x_ (0), container_ (c) - { -#ifdef XSD_CXX11 - set (std::move (x)); -#else - set (x); -#endif - } - - template - optional:: - optional (const optional& x, flags f, container* c) - : x_ (0), container_ (c) - { - if (x) - set (*x, f); - } - - template - optional& optional:: - operator= (const T& x) - { - if (x_ == &x) - return *this; - - set (x); - - return *this; - } - - template - optional& optional:: - operator= (const optional& x) - { - if (this == &x) - return *this; - - if (x) - set (*x); - else - reset (); - - return *this; - } - - template - void optional:: - set (const T& x, flags f) - { - // We always do a fresh copy because T may not be x's - // dynamic type. - // - T* r (x._clone (f, container_)); - - delete x_; - x_ = r; - } - - template - void optional:: - set (XSD_AUTO_PTR x) - { - T* r (0); - - if (x.get () != 0) - { - if (x->_container () != container_) - x->_container (container_); - - r = x.release (); - } - - delete x_; - x_ = r; - } - - template - void optional:: - reset () - { - delete x_; - x_ = 0; - } - - template - void optional:: - true_ () - { - } - - - // optional - // - template - optional:: - optional (const T& y, container*) - : present_ (false) - { - set (y); - } - - template - optional:: - optional (const optional& y, flags, container*) - : present_ (false) - { - if (y) - set (*y); - } - - template - optional& optional:: - operator= (const T& y) - { - if (&x_ == &y) - return *this; - - set (y); - - return *this; - } - - template - optional& optional:: - operator= (const optional& y) - { - if (this == &y) - return *this; - - if (y) - set (*y); - else - reset (); - - return *this; - } - - template - void optional:: - true_ () - { - } - - template - std::basic_ostream& - operator<< (std::basic_ostream& os, const optional& x) - { - if (x) - os << *x; - else - os << bits::not_present (); - - return os; - } - } - } -} -- cgit v1.1