ALPSCore reference
change_value_type.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 1998-2018 ALPS Collaboration. See COPYRIGHT.TXT
3  * All rights reserved. Use is subject to license terms. See LICENSE.TXT
4  * For use in publications, see ACKNOWLEDGE.TXT
5  */
6 
7 /* $Id: obsvalue.h 3435 2009-11-28 14:45:38Z troyer $ */
8 
9 #ifndef ALPS_TYPE_TRAITS_CHANGE_VALUE_TYPE_H
10 #define ALPS_TYPE_TRAITS_CHANGE_VALUE_TYPE_H
11 
12 #include <alps/config.hpp>
13 #include <valarray>
14 #include <vector>
15 
16 // maybe we can automate this by checking for the existence of a value_type member
17 
18 namespace alps {
19 
20 template <class T, class V>
22 {
23  typedef V type;
24 };
25 
26 template <class T, class A, class V>
27 struct change_value_type<std::vector<T,A>,V>
28 {
29  typedef std::vector<V> type;
30 };
31 
32 template <class T, class V>
33 struct change_value_type<std::valarray<T>,V>
34 {
35  typedef std::valarray<V> type;
36 };
37 
38 template <class T, class V>
40 
41 template <class T, class V>
43 {
44  typedef std::vector<V> type;
45 };
46 
47 } // end namespace alps
48 
49 #endif // ALPS_TYPE_TRAITS_CHANGE_VALUE_TYPE_H
STL namespace.