What is (in simple understanding) narrow contract and wide contract in terms of c++ interface(s)?
问题 While walking through some c++11 concepts, I came across the terms narrow contract and wide contract . But I failed to figure out a simple function example(s) which is/are written for these contracts. Can I see a simple function example that distinguishes between these two contracts? 回答1: Wide contract functions have well-defined behavior for all possible inputs, while narrow contracts mean that the functions can only be called when certain preconditions are met. Note that input might include