Skip to content

Commit

Permalink
belクラスの作成開始
Browse files Browse the repository at this point in the history
  • Loading branch information
yumetodo committed Mar 14, 2016
1 parent d740717 commit b0f9d97
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions dxlibex/basic_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "dxlibex/basic_types/point3d.hpp"
#include "dxlibex/basic_types/size.hpp"
#include "dxlibex/basic_types/tchar.hpp"
#include "dxlibex/basic_types/bel.hpp"
namespace dxle {

//operators betwin point_c and size_c
Expand Down
24 changes: 24 additions & 0 deletions dxlibex/basic_types/bel.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*=============================================================================
Copyright (C) 2015-2016 DxLibEx project
https://github.com/Nagarei/DxLibEx/
Distributed under the Boost Software License, Version 1.0.
(See http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef DXLE_INC_BASIC_TYPES_BEL_HPP_
#define DXLE_INC_BASIC_TYPES_BEL_HPP_
#include <limits>
#include <ratio>
#include <utility>
#include "dxlibex/type_traits/is_ratio.hpp"
#include "dxlibex/type_traits/enable_if.hpp"
namespace dxle {
typedef std::ratio<1, 10000> myrio;
namespace sound_units {
template<typename T, typename Period, enable_if<is_ratio<Period>::value, nullptr_t> = nullptr>
class bel {

};
}
}
#endif //DXLE_INC_BASIC_TYPES_BEL_HPP_
1 change: 1 addition & 0 deletions dxlibex/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
#include "dxlibex/type_traits/is_nothrow.hpp"
#include "dxlibex/type_traits/is_representable.hpp"
#include "dxlibex/type_traits/is_well_format.hpp"
#include "dxlibex/type_traits/is_ratio.hpp"

#endif//#ifndef DXLE_INC_TYPE_TRAITS_HPP_
17 changes: 17 additions & 0 deletions dxlibex/type_traits/is_ratio.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*=============================================================================
Copyright (C) 2015-2016 DxLibEx project
https://github.com/Nagarei/DxLibEx/
Distributed under the Boost Software License, Version 1.0.
(See http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
#ifndef DXLE_INC_TYPE_TRAITS_IS_RATIO_HPP_
#define DXLE_INC_TYPE_TRAITS_IS_RATIO_HPP_
#include <ratio>
#include <type_traits>
#include <cstdint>
namespace dxle {
template <typename T> struct is_ratio : std::false_type {};
template <std::intmax_t N, std::intmax_t D> struct is_ratio<std::ratio<N, D>> : std::true_type {};
}
#endif //DXLE_INC_TYPE_TRAITS_IS_RATIO_HPP_

1 comment on commit b0f9d97

@yumetodo
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#51

Please sign in to comment.