MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / wait

Function wait

source/matplot/util/common.cpp:231–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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_

Callers 1

showMethod · 0.85

Calls 2

clearMethod · 0.80
maxFunction · 0.70

Tested by

no test coverage detected