JayBeams  0.1
Another project to have fun coding.
future_status.hpp
Go to the documentation of this file.
1 #ifndef jb_testing_future_status_hpp
2 #define jb_testing_future_status_hpp
3 /**
4  * @file
5  *
6  * Helper function for Boost.Tests that use std::future_status.
7  */
8 #include <future>
9 #include <iostream>
10 
11 namespace std {
12 // Introduce a streaming operator to satify Boost.Test needs.
13 inline std::ostream& operator<<(std::ostream& os, std::future_status x) {
14  if (x == std::future_status::timeout) {
15  return os << "[timeout]";
16  }
17  if (x == std::future_status::ready) {
18  return os << "[ready]";
19  }
20  return os << "[deferred]";
21 }
22 }
23 
24 #endif // jb_testing_future_status_hpp
STL namespace.