Joseph Rushton Wakeling: > >> final size_t select(ref UniformRNG urng) > >> { > >> assert(_recordsRemaining > 0); > >> assert(_sampleRemaining > 0); > > > > Probably it's better to move those asserts in preconditions/postconditions > > or in > > class/struct invariants. > > Those asserts are deliberately intended for the function.
Then use a function/method precondition: final size_t select(ref UniformRNG urng) in { assert(_recordsRemaining > 0); assert(_sampleRemaining > 0); } body { ... } Bye, bearophile