Skip to content

Commit

Permalink
VSでUDLsが動かないのはnamespaceで囲った後using namespaceしたからではないかと疑い、グローバル名前空間で定義す…
Browse files Browse the repository at this point in the history
…るも失敗する
  • Loading branch information
yumetodo committed Mar 14, 2016
1 parent a949a74 commit c30b32b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
14 changes: 12 additions & 2 deletions dxlibex/basic_types/bel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,14 +114,24 @@ namespace dxle {
using namespace sound_units;
}
#ifdef DXLE_SUPPORT_CXX11_USER_DEFINED_LITERALS
#if !defined(_MSC_VER) || defined(__clang__)
namespace dxle { namespace sound_units { namespace sound_units_literals {
inline constexpr myrio_bel operator "" _myrioB(unsigned long long myrioB) {
#else
# define myrio_bel dxle::myrio_bel
# define deci_bel dxle::deci_bel
#endif
inline DXLE_CONSTEXPR myrio_bel operator "" _myrioB(unsigned long long myrioB) {
return myrio_bel(static_cast<int>(myrioB));
}
inline constexpr myrio_bel operator "" _dB(unsigned long long myrioB) {
inline DXLE_CONSTEXPR deci_bel operator "" _dB(unsigned long long myrioB) {
return deci_bel(static_cast<int>(myrioB));
}
#if !defined(_MSC_VER) || defined(__clang__)
} } }
using namespace dxle::sound_units::sound_units_literals;
#else
# undef myrio_bel
# undef deci_bel
#endif
#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 @@ -6,4 +6,5 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
constexpr auto rate = 300_dB;
constexpr auto rate2 = 4000_myrioB;
constexpr auto rate3 = dxle::bel_cast<dxle::bel>(rate);
constexpr dxle::deci_bel rate4(100);
}

0 comments on commit c30b32b

Please sign in to comment.