5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "default_common.hxx"
22 LIBT2N_EXPORT std::string testfunc(std::string str)
26 throw libt2n::t2n_runtime_error("throw me around");
28 ret.insert(0,100*1024,'x');
30 ret=str+", testfunc() was here";
34 //! test pass by const reference
35 LIBT2N_EXPORT std::string testfunc_ref(const std::string &str)
39 throw libt2n::t2n_runtime_error("throw me around");
41 ret.insert(0,100*1024,'x');
43 ret=str+", testfunc() was here";
48 LIBT2N_EXPORT int t2(int i)
53 //! test const ref of builtin
54 LIBT2N_EXPORT int t3(const int &i)
59 //! test pointer to const data
60 LIBT2N_EXPORT int t4(const int* i)
66 LIBT2N_EXPORT int t5()
71 //! test no args and no return
72 LIBT2N_EXPORT void t6()
74 throw libt2n::t2n_runtime_error("throw me around2");
81 for (typename X::const_iterator it=x.begin();it!=x.end();++it)
86 // todo: export of explicitely instantiated template functions doesn't work
89 LIBT2N_EXPORT unsigned sum(const std::vector<unsigned> &v)
93 LIBT2N_EXPORT unsigned sum(const std::list<unsigned> &v)
97 LIBT2N_EXPORT unsigned sum(const std::set<unsigned> &v)
100 //! test return of std::pair
101 LIBT2N_EXPORT std::pair<int,int> pdup(int i) {
102 return std::pair<int,int>(i,i);
106 todo: boost doesn't provide serialization for boost tuple :-(
107 //! test return of boost::tuple
108 LIBT2N_EXPORT boost::tuple<int,int,int,int> quad(int i) {
109 return std::tuple<int,int,int,int>(i,i,i,i);