]> Dogcows Code - chaz/yoink/blob - src/Moof/cml/quaternion/quaternion_traits.h
bugfix: win32 packaging script temp directories
[chaz/yoink] / src / Moof / cml / quaternion / quaternion_traits.h
1 /* -*- C++ -*- ------------------------------------------------------------
2
3 Copyright (c) 2007 Jesse Anders and Demian Nave http://cmldev.net/
4
5 The Configurable Math Library (CML) is distributed under the terms of the
6 Boost Software License, v1.0 (see cml/LICENSE for details).
7
8 *-----------------------------------------------------------------------*/
9 /** @file
10 * @brief
11 */
12
13 #ifndef quaternion_traits_h
14 #define quaternion_traits_h
15
16 #include <cml/et/traits.h>
17
18 namespace cml {
19 namespace et {
20
21 /** Expression traits for a quaternion<> type. */
22 template<typename E, class AT, class OT, class CT>
23 struct ExprTraits< cml::quaternion<E,AT,OT,CT> >
24 {
25 typedef typename cml::quaternion<E,AT,OT,CT>::expr_type expr_type;
26 typedef typename expr_type::value_type value_type;
27 typedef typename expr_type::expr_reference reference;
28 typedef typename expr_type::expr_const_reference const_reference;
29 typedef typename expr_type::result_tag result_tag;
30 typedef typename expr_type::size_tag size_tag;
31 typedef typename expr_type::assignable_tag assignable_tag;
32 typedef expr_type result_type;
33 typedef expr_leaf_tag node_tag;
34
35 value_type get(const expr_type& v, size_t i) const { return v[i]; }
36 size_t size(const expr_type& v) const { return 4; }
37 };
38
39 } // namespace et
40 } // namespace cml
41
42 #endif
43
44 // -------------------------------------------------------------------------
45 // vim:ft=cpp
This page took 0.032954 seconds and 4 git commands to generate.