Skip to content

Commit

Permalink
#53 #51 sound_units_literalsのusing namespaceをグローバルからsound_unitsの中に移動
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagarei committed Mar 16, 2016
1 parent 3b993e1 commit 6345cde
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
19 changes: 19 additions & 0 deletions ProjectDxLibEx.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "UnitTest", "tests\UnitTest\
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WithDxLib", "tests\WithDxLib\WithDxLib.vcxproj", "{280349E1-6523-4483-97DB-2D16B0716396}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sound_play", "samples\sound_play\sound_play\sound_play.vcxproj", "{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
clang_Debug|Win32 = clang_Debug|Win32
Expand Down Expand Up @@ -119,6 +121,22 @@ Global
{280349E1-6523-4483-97DB-2D16B0716396}.Release|Win32.ActiveCfg = Release|Win32
{280349E1-6523-4483-97DB-2D16B0716396}.Release|Win32.Build.0 = Release|Win32
{280349E1-6523-4483-97DB-2D16B0716396}.Release|x64.ActiveCfg = Release|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Debug|Win32.ActiveCfg = clang_Debug|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Debug|Win32.Build.0 = clang_Debug|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Debug|x64.ActiveCfg = clang_Debug|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Debug|x64.Build.0 = clang_Debug|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Release|Win32.ActiveCfg = clang_Release|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Release|Win32.Build.0 = clang_Release|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Release|x64.ActiveCfg = clang_Release|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.clang_Release|x64.Build.0 = clang_Release|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Debug|Win32.ActiveCfg = Debug|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Debug|Win32.Build.0 = Debug|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Debug|x64.ActiveCfg = Debug|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Debug|x64.Build.0 = Debug|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Release|Win32.ActiveCfg = Release|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Release|Win32.Build.0 = Release|Win32
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Release|x64.ActiveCfg = Release|x64
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4}.Release|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -129,5 +147,6 @@ Global
{D0B701B2-9FFB-45DC-A26E-4C9012E0D237} = {8301B3DC-D95E-4277-8614-FE1CF783AB18}
{44682BAF-4F62-42D9-90EB-D7F46CD21B95} = {373EF964-F08D-40C8-8543-221ADCE91DE5}
{280349E1-6523-4483-97DB-2D16B0716396} = {373EF964-F08D-40C8-8543-221ADCE91DE5}
{BF458CEF-25D4-4FA5-AFF9-BF4BA4C14AD4} = {8301B3DC-D95E-4277-8614-FE1CF783AB18}
EndGlobalSection
EndGlobal
2 changes: 2 additions & 0 deletions ProjectDxLibEx.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ClInclude Include="dxlibex\algorithm\cast_if.hpp" />
<ClInclude Include="dxlibex\algorithm\safe_dist.hpp" />
<ClInclude Include="dxlibex\basic_types.hpp" />
<ClInclude Include="dxlibex\basic_types\bel.hpp" />
<ClInclude Include="dxlibex\basic_types\use_big_type_when_one_byte_t.hpp" />
<ClInclude Include="dxlibex\basic_types\coordinate_operator_bool_helper.hpp" />
<ClInclude Include="dxlibex\basic_types\distance_result_type_t.hpp" />
Expand Down Expand Up @@ -61,6 +62,7 @@
<ClInclude Include="dxlibex\type_traits\ignore.hpp" />
<ClInclude Include="dxlibex\type_traits\is_castable.hpp" />
<ClInclude Include="dxlibex\type_traits\is_nothrow.hpp" />
<ClInclude Include="dxlibex\type_traits\is_ratio.hpp" />
<ClInclude Include="dxlibex\type_traits\is_representable.hpp" />
<ClInclude Include="dxlibex\type_traits\is_well_format.hpp" />
</ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions ProjectDxLibEx.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -182,5 +182,11 @@
<ClInclude Include="dxlibex\Sound.h">
<Filter>dxlibex</Filter>
</ClInclude>
<ClInclude Include="dxlibex\basic_types\bel.hpp">
<Filter>dxlibex\basic_types</Filter>
</ClInclude>
<ClInclude Include="dxlibex\type_traits\is_ratio.hpp">
<Filter>dxlibex\type_traits</Filter>
</ClInclude>
</ItemGroup>
</Project>
5 changes: 3 additions & 2 deletions dxlibex/basic_types/bel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ namespace dxle { namespace sound_units { namespace sound_units_literals {
inline DXLE_CONSTEXPR deci_bel operator "" _dB(unsigned long long myrioB) {
return deci_bel(static_cast<int>(myrioB));
}
} } }
using namespace dxle::sound_units::sound_units_literals;
}
using namespace sound_units_literals;
}}
#endif
#endif //DXLE_INC_BASIC_TYPES_BEL_HPP_
1 change: 1 addition & 0 deletions samples/sound_play/sound_play/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nCmdShow*/) {
//SetCreateSoundPitchRate(100);
#ifdef DXLE_SUPPORT_CXX11_USER_DEFINED_LITERALS
using namespace dxle::sound_units_literals;
constexpr auto rate = 300_dB;
constexpr auto rate2 = 4000_myrioB;
constexpr auto rate3 = dxle::bel_cast<dxle::bel>(rate);
Expand Down

4 comments on commit 6345cde

@yumetodo
Copy link
Collaborator

Choose a reason for hiding this comment

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

@Nagarei それって使いにくくないですかね・・・。
STLのUDLsってどうなってましたっけ(使ったこと無い)

@Nagarei
Copy link
Owner Author

Choose a reason for hiding this comment

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

@yumetodo STLはusing namespaceをユーザーが使う設計になってます。
nsリテラル
basic_string::sリテラル
STLにはliterals名前空間があるのですが、今回はとりあえず作っていません。

@yumetodo
Copy link
Collaborator

Choose a reason for hiding this comment

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

なるほど。
literals名前空間作ります?

@Nagarei
Copy link
Owner Author

Choose a reason for hiding this comment

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

作りました。
1c077a1

Please sign in to comment.