ALPS MPS Codes
Reference documentation.
Main Page
Related Pages
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
framework
utils
sizeof.h
Go to the documentation of this file.
1
/*****************************************************************************
2
*
3
* MAQUIS Project
4
*
5
* 2011-2011 by Bela Bauer <bauerb@phys.ethz.ch>
6
*
7
* This software is part of the ALPS Applications, published under the ALPS
8
* Application License; you can use, redistribute it and/or modify it under
9
* the terms of the license, either version 1 or (at your option) any later
10
* version.
11
*
12
* You should have received a copy of the ALPS Application License along with
13
* the ALPS Applications; see the file LICENSE.txt. If not, the license is also
14
* available from http://alps.comp-phys.org/.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
19
* SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
20
* FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
21
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22
* DEALINGS IN THE SOFTWARE.
23
*
24
*****************************************************************************/
25
26
#ifndef MAQUIS_SIZEOF_H
27
#define MAQUIS_SIZEOF_H
28
29
namespace
utils
30
{
31
template
<
class
Iterator>
32
std::size_t
size_of
(Iterator i1, Iterator i2)
33
{
34
std::size_t r = 0;
35
for
( ; i1 != i2; ++i1)
36
r +=
size_of
(*i1);
37
return
r;
38
}
39
}
40
41
#endif
utils::size_of
std::size_t size_of(Iterator i1, Iterator i2)
Definition:
sizeof.h:32
Generated on Thu Aug 21 2014 11:18:55 for ALPS MPS Codes by
1.8.7