ivl 679
|
00001 /* This file is part of the ivl C++ library <http://image.ntua.gr/ivl>. 00002 A C++ template library extending syntax towards mathematical notation. 00003 00004 Copyright (C) 2012 Yannis Avrithis <iavr@image.ntua.gr> 00005 Copyright (C) 2012 Kimon Kontosis <kimonas@image.ntua.gr> 00006 00007 ivl is free software; you can redistribute it and/or modify 00008 it under the terms of the GNU Lesser General Public License 00009 version 3 as published by the Free Software Foundation. 00010 00011 Alternatively, you can redistribute it and/or modify it under the terms 00012 of the GNU General Public License version 2 as published by the Free 00013 Software Foundation. 00014 00015 ivl is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00018 See the GNU General Public License for more details. 00019 00020 You should have received a copy of the GNU General Public License 00021 and a copy of the GNU Lesser General Public License along 00022 with ivl. If not, see <http://www.gnu.org/licenses/>. */ 00023 00024 #ifndef IVL_ARRAY_DETAILS_ALL_ARRAY_HPP 00025 #define IVL_ARRAY_DETAILS_ALL_ARRAY_HPP 00026 00027 namespace ivl { 00028 00029 template<class A, bool IS_CONST> 00030 class all_array 00031 : public array<typename A::elem_type, 00032 data::ref_iterator< 00033 typename types::t_if<types::t_expr<IS_CONST>, types::term, 00034 typename A::iterator>::type, 00035 typename A::const_iterator> > 00036 { 00037 private: 00038 typedef all_array prv_this_type; 00039 typedef typename prv_this_type::array_type base_class; 00040 00041 public: 00042 all_array(typename 00043 types::t_if<types::t_expr<IS_CONST>, const A&, A&>::type a) 00044 : base_class(a.begin(), a.length(), a.end()) { } 00045 00046 all_array(const all_array& o) : base_class(o) { } 00047 00048 //using base_class::operator=; 00049 00050 /* No need for this anymore. The correct thing happens with operator= 00051 automatically as long as it detects that iter_array is not resizeable 00052 all_array& operator=(const typename A::elem_type& val) 00053 { 00054 base_class::operator=(array<typename A::elem_type, 00055 data::ref_val_repeat, types::term>(this->length(), val)); 00056 return *this; 00057 } 00058 */ 00059 template<class K> 00060 all_array& operator=(const K& k) 00061 { 00062 base_class::operator=(k); 00063 return *this; 00064 } 00065 00066 all_array& operator=(const all_array& o) 00067 { 00068 base_class::operator=(o); 00069 return *this; 00070 } 00071 }; 00072 00073 00074 } // namespace ivl 00075 00076 #endif // IVL_ARRAY_DETAILS_ALL_ARRAY_HPP