DxLibEx
DxLibEx copied to clipboard
ベル、デシベルといった単位用のクラス作成
#42 で必要そう。
std::chrono::durationを参考に作る
DxLibで 10^-4のオーダーが求められることがあるので(パンとか)SI単位では認められないが、myrioを導入する
namespace dxle {
namespace literals {
namespace sound_units_literals {
//略
}
using namespace sound_units_literals;
}
using namespace literals;
namespace sound_units {
using namespace literals::sound_units_literals;
}
}
となっているんですが、
using namespace literals;
namespace sound_units {
using namespace literals::sound_units_literals;
}
これは良くない気がします・・・標準でもそうはなっていないですし http://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s
追記
そんなことはなかった。using namesapce std;でもつかえるのか。
http://melpon.org/wandbox/permlink/HncqwQrsUDgd6m2P
21.7 Suffix for basic_string literals [basic.string.literals] string operator "" s(const char* str, size_t len); 1 Returns: string{str,len} u16string operator "" s(const char16_t* str, size_t len); 2 Returns: u16string{str,len} u32string operator "" s(const char32_t* str, size_t len); 3 Returns: u32string{str,len} wstring operator "" s(const wchar_t* str, size_t len); 4 Returns: wstring{str,len} 5 [ Note: The same suffix s is used for chrono::duration literals denoting seconds but there is no conflict, since duration suffixes apply to numbers and string literal suffixes apply to character array literals. —end note ]
規格書にはこれしか書いてないけど
http://en.cppreference.com/w/cpp/string/basic_string/operator%22%22s Access to these operators can be gained with
using namespace std::literals,using namespace std::string_literals, andusing namespace std::literals::string_literals.
この一文はどこから出てきたんだろう