Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/marian-nmt/intgemm.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Chudyk <mateuszchudyk@gmail.com>2019-06-21 14:11:01 +0300
committerMateusz Chudyk <mateuszchudyk@gmail.com>2019-06-21 14:48:49 +0300
commit9ac27d7de2965fb8129bfc00f27319acfb20cd5a (patch)
tree41bee09172191e6443f559af88e6eaa78f23c68a /aligned.h
parent1af38c949cefccdb998ea4d79c546eefc89a9f3f (diff)
Use AlignedVector in tests
Diffstat (limited to 'aligned.h')
-rw-r--r--aligned.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/aligned.h b/aligned.h
index 7514000..6795788 100644
--- a/aligned.h
+++ b/aligned.h
@@ -22,6 +22,9 @@ template <class T> class AlignedVector {
T *end() { return mem_ + size_; }
const T *end() const { return mem_ + size_; }
+ template <typename ReturnType>
+ ReturnType *as() { return reinterpret_cast<ReturnType*>(mem_); }
+
private:
T *mem_;
std::size_t size_;