mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-02 19:24:25 +00:00
demonstrate usage of Cases() mapping several strings to the same value; remove trailing spaces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90230 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -35,7 +35,7 @@ namespace llvm {
|
|||||||
/// .Case("green", Green)
|
/// .Case("green", Green)
|
||||||
/// .Case("blue", Blue)
|
/// .Case("blue", Blue)
|
||||||
/// .Case("indigo", Indigo)
|
/// .Case("indigo", Indigo)
|
||||||
/// .Case("violet", Violet)
|
/// .Cases("violet", "purple", Violet)
|
||||||
/// .Default(UnknownColor);
|
/// .Default(UnknownColor);
|
||||||
/// \endcode
|
/// \endcode
|
||||||
template<typename T>
|
template<typename T>
|
||||||
@ -87,7 +87,7 @@ public:
|
|||||||
template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4>
|
template<unsigned N0, unsigned N1, unsigned N2, unsigned N3, unsigned N4>
|
||||||
StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
|
StringSwitch& Cases(const char (&S0)[N0], const char (&S1)[N1],
|
||||||
const char (&S2)[N2], const char (&S3)[N3],
|
const char (&S2)[N2], const char (&S3)[N3],
|
||||||
const char (&S4)[N4], const T& Value) {
|
const char (&S4)[N4], const T& Value) {
|
||||||
return Case(S0, Value).Case(S1, Value).Case(S2, Value).Case(S3, Value)
|
return Case(S0, Value).Case(S1, Value).Case(S2, Value).Case(S3, Value)
|
||||||
.Case(S4, Value);
|
.Case(S4, Value);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user