]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/cxx/lib/tl/include/arith
Inital import
[l4.git] / l4 / pkg / cxx / lib / tl / include / arith
1 // vi:ft=cpp
2 /*
3  * (c) 2008-2009 Technische Universität Dresden
4  * This file is part of TUD:OS and distributed under the terms of the
5  * GNU General Public License 2.
6  * Please see the COPYING-GPL-2 file for details.
7  *
8  * As a special exception, you may use this file as part of a free software
9  * library without restriction.  Specifically, if other files instantiate
10  * templates or use macros or inline functions from this file, or you compile
11  * this file and link it with other files to produce an executable, this
12  * file does not by itself cause the resulting executable to be covered by
13  * the GNU General Public License.  This exception does not however
14  * invalidate any other reasons why the executable file might be covered by
15  * the GNU General Public License.
16  */
17
18 #pragma once
19
20 namespace cxx { namespace arith {
21
22 template< unsigned long V >
23 struct Ld
24 {
25   enum { value = Ld<V / 2>::value + 1 };
26 };
27
28 template<>
29 struct Ld<0>
30 {
31   enum { value = ~0UL };
32 };
33
34 template<>
35 struct Ld<1>
36 {
37   enum { value = 0 };
38 };
39
40 }}