Consider this code:
#include <iostream>
using namespace std;
int main() {
//...
cin.ignore(numeric_limits<streamsize>::max(), '\n');
//...
}
I don't have the limits library included. I can compile this with g++ on my mac without a problem, however on my school computer it gives an error saying '>' is not declared. It will however compile if I include the limits library. Does my mac's g++ automatically include certain libraries? If so, how do I find out what's automatically included?
This is my g++ version:
NoobCoders-MacBook-Pro:as1 NoobCoder$ g++ -v
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-
include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin15.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Thanks!