This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Define an optional chaining pipeline operator | |
| operator infix |> { associativity left } | |
| func |> <T, U>(t: T?, f: (T) -> U? ) -> U? { | |
| if let t1 = t { return f( t1 ) } | |
| else { return nil } | |
| } | |
| // some dummy classes and functions to chain together | |
| class C { let x = 7 } | |
| class B { } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct MaxUsage { int memory, disk; }; | |
| TEST_CASE( "KeyValueBuffer disk memory usage" ) | |
| { | |
| using namespace Catch::Generators; | |
| MaxUsage params[] = { | |
| { 1, 2 }, | |
| { 1, 1024 }, | |
| { 8, 1024 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <cassert> | |
| #include <iostream> | |
| template<typename T, typename R=void> | |
| struct ExtMethod { | |
| ExtMethod& operator - () { | |
| return *this; | |
| } | |
| template<typename U> |
NewerOlder