| 229 | #undef max |
| 230 | #endif |
| 231 | void wait() { |
| 232 | #ifdef MATPLOT_BUILD_FOR_DOCUMENTATION_IMAGES |
| 233 | return; |
| 234 | #endif |
| 235 | // http://www.cplusplus.com/forum/beginner/106769/#msg578325 |
| 236 | // Clear failed/error states of the stream if they are set |
| 237 | std::cin.clear(); |
| 238 | |
| 239 | // If there are any characters in the input buffer |
| 240 | if (std::cin.rdbuf()->in_avail()) { |
| 241 | // Throw them away |
| 242 | std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); |
| 243 | } |
| 244 | |
| 245 | std::cout << "Press ENTER to continue..."; |
| 246 | std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); |
| 247 | } |
| 248 | #ifdef _Temp_MACRO_ |
| 249 | // restore the max() macro. |
| 250 | #define max _TEMP_MACRO_ |