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 <array> | |
| #include <type_traits> | |
| template<typename F> | |
| auto foo(F f) -> typename std::enable_if< | |
| std::is_same<decltype(f(std::declval<int>(), std::declval<int>())), std::array<int, 2>>::value, | |
| std::array<int, 2> | |
| >::type | |
| { | |
| return f(1, 2); |
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
| use validator::Validate; | |
| impl<T: Validate> Validate for swagger::Nullable<T> { | |
| fn validate(&self) -> Result<(), validator::ValidationErrors> { | |
| match self { | |
| swagger::Nullable::Value(v) => v.validate(), | |
| swagger::Nullable::Null => Ok(()), | |
| } | |
| } | |
| } |