This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
double square_root (double x) { if (x < 0) throw bad_arg(); else return std::sqrt (x); }
So it may or may not throw, but it will do so consistently depending on its arguments. If it's pure, it will throw consistently depending on its arguments and memory.
Are you sure this makes sense? The act of throwing an exception writes to (thread local) memory.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |