1
0
Fork 0
mirror of https://github.com/bolero-MURAKAMI/Sprout synced 2024-11-12 21:09:01 +00:00

add quaternion container interface

This commit is contained in:
bolero-MURAKAMI 2016-02-26 23:19:42 +09:00
parent 97e8cfc2c0
commit 35bd69d5d3
4 changed files with 1781 additions and 1517 deletions

View file

@ -40,8 +40,8 @@ namespace sprout {
typedef typename array_type::size_type size_type; typedef typename array_type::size_type size_type;
typedef typename array_type::pointer pointer; typedef typename array_type::pointer pointer;
typedef typename array_type::const_pointer const_pointer; typedef typename array_type::const_pointer const_pointer;
typedef typename array_type::pointer reverse_iterator; typedef typename array_type::reverse_iterator reverse_iterator;
typedef typename array_type::pointer const_reverse_iterator; typedef typename array_type::const_reverse_iterator const_reverse_iterator;
public: public:
SPROUT_STATIC_CONSTEXPR size_type static_size = array_type::static_size; SPROUT_STATIC_CONSTEXPR size_type static_size = array_type::static_size;
private: private:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,43 @@
/*=============================================================================
Copyright (c) 2011-2016 Bolero MURAKAMI
https://github.com/bolero-MURAKAMI/Sprout
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef SPROUT_QUATERNION_CONTAINER_HPP
#define SPROUT_QUATERNION_CONTAINER_HPP
#include <type_traits>
#include <sprout/utility/forward.hpp>
#include <sprout/math/quaternion/quaternion.hpp>
#include <sprout/container/traits.hpp>
namespace sprout {
//
// container_construct_traits
//
template<typename T>
struct container_construct_traits<sprout::math::quaternion<T> > {
public:
typedef sprout::math::quaternion<T> copied_type;
public:
template<typename Cont>
static SPROUT_CONSTEXPR copied_type
deep_copy(Cont&& cont) {
return SPROUT_FORWARD(Cont, cont);
}
template<typename... Args>
static SPROUT_CONSTEXPR copied_type
make(Args&&... args) {
return copied_type(SPROUT_FORWARD(Args, args)...);
}
template<typename Cont, typename... Args>
static SPROUT_CONSTEXPR copied_type
remake(Cont&&, typename sprout::container_traits<sprout::math::quaternion<T> >::difference_type, Args&&... args) {
return copied_type(SPROUT_FORWARD(Args, args)...);
}
};
} // namespace sprout
#endif // #ifndef SPROUT_QUATERNION_CONTAINER_HPP

File diff suppressed because it is too large Load diff