Recovering options to getopt after a GetOptException is raised

2015-10-07 Thread Charles McAnany via Digitalmars-d
Friends, I'm a bit puzzled by the behavior of this code: import std.getopt; import std.stdio; void main(string[] args){ string val; GetoptResult opts; try{ opts = getopt(args, std.getopt.config.required, "val", "value you need to specify", &val); }catch(GetOptException

Overloading opEquals(T)(T y)

2011-02-07 Thread Charles McAnany
Hi, all. So I'm trying to make a BigRational struct, to get more comfortable with D. I'm working on the opEquals part now, and I'm having some difficulty. I'd like to write an equality checker for two BigRationals, and have all other comparisons make a BigRational of the rhs and then forward that t