]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/boost/qvm/detail/vec_assign.hpp
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / boost / boost / qvm / detail / vec_assign.hpp
CommitLineData
92f5a8d4
TL
1//Copyright (c) 2008-2016 Emil Dotchevski and Reverge Studios, Inc.
2
3//Distributed under the Boost Software License, Version 1.0. (See accompanying
4//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
5
f67539c2
TL
6#ifndef BOOST_QVM_185557CE385511E780ACD7B781262D2E
7#define BOOST_QVM_185557CE385511E780ACD7B781262D2E
92f5a8d4
TL
8
9#include <boost/qvm/gen/vec_assign2.hpp>
10#include <boost/qvm/gen/vec_assign3.hpp>
11#include <boost/qvm/gen/vec_assign4.hpp>
12
13namespace
14boost
15 {
16 namespace
17 qvm
18 {
19 namespace
20 qvm_detail
21 {
22 template <int D>
23 struct
24 assign_vv_defined
25 {
26 static bool const value=false;
27 };
28
29 template <int I,int N>
30 struct
31 copy_vector_elements
32 {
33 template <class A,class B>
34 static
35 void
36 f( A & a, B const & b )
37 {
38 vec_traits<A>::template write_element<I>(a)=vec_traits<B>::template read_element<I>(b);
39 copy_vector_elements<I+1,N>::f(a,b);
40 }
41 };
42
43 template <int N>
44 struct
45 copy_vector_elements<N,N>
46 {
47 template <class A,class B>
48 static
49 void
50 f( A &, B const & )
51 {
52 }
53 };
54 }
55
56 template <class A,class B>
57 inline
58 typename boost::enable_if_c<
59 is_vec<A>::value && is_vec<B>::value &&
60 vec_traits<A>::dim==vec_traits<B>::dim &&
61 !qvm_detail::assign_vv_defined<vec_traits<A>::dim>::value,
62 A &>::type
63 assign( A & a, B const & b )
64 {
65 qvm_detail::copy_vector_elements<0,vec_traits<A>::dim>::f(a,b);
66 return a;
67 }
68 }
69 }
70
71#endif