Intel(R) Threading Building Blocks Doxygen Documentation  version 4.2.3
aligned_space.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2005-2019 Intel Corporation
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 
16 
17 
18 
19 */
20 
21 #ifndef __TBB_aligned_space_H
22 #define __TBB_aligned_space_H
23 
24 #include "tbb_stddef.h"
25 #include "tbb_machine.h"
26 
27 namespace tbb {
28 
30 
32 template<typename T,size_t N=1>
34 private:
35  typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type;
36  element_type array[(sizeof(T)*N+sizeof(element_type)-1)/sizeof(element_type)];
37 public:
39  T* begin() const {return internal::punned_cast<T*>(this);}
40 
42  T* end() const {return begin()+N;}
43 };
44 
45 } // namespace tbb
46 
47 #endif /* __TBB_aligned_space_H */
typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type
T * begin() const
Pointer to beginning of array.
Definition: aligned_space.h:39
element_type array[(sizeof(T) *N+sizeof(element_type) -1)/sizeof(element_type)]
Definition: aligned_space.h:36
The graph class.
T * end() const
Pointer to one past last element in array.
Definition: aligned_space.h:42
Block of space aligned sufficiently to construct an array T with N elements.
Definition: aligned_space.h:33

Copyright © 2005-2019 Intel Corporation. All Rights Reserved.

Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are registered trademarks or trademarks of Intel Corporation or its subsidiaries in the United States and other countries.

* Other names and brands may be claimed as the property of others.