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 #ifndef __TBB_aligned_space_H
18 #define __TBB_aligned_space_H
19 
20 #include "tbb_stddef.h"
21 #include "tbb_machine.h"
22 
23 namespace tbb {
24 
26 
28 template<typename T,size_t N=1>
30 private:
31  typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type;
32  element_type array[(sizeof(T)*N+sizeof(element_type)-1)/sizeof(element_type)];
33 public:
35  T* begin() const {return internal::punned_cast<T*>(this);}
36 
38  T* end() const {return begin()+N;}
39 };
40 
41 } // namespace tbb
42 
43 #endif /* __TBB_aligned_space_H */
The graph class.
T * end() const
Pointer to one past last element in array.
Definition: aligned_space.h:38
T * begin() const
Pointer to beginning of array.
Definition: aligned_space.h:35
Block of space aligned sufficiently to construct an array T with N elements.
Definition: aligned_space.h:29
typedef __TBB_TypeWithAlignmentAtLeastAsStrict(T) element_type
element_type array[(sizeof(T) *N+sizeof(element_type) -1)/sizeof(element_type)]
Definition: aligned_space.h:32

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.