Search Results

Search found 2 results on 1 pages for 'martinp'.

Page 1/1 | 1 

  • What does: throw 0 do/mean? Is it "bad"?

    - by MartinP
    Context I came across some code, like this: if( Some_Condition ) throw 0; I googled a bit, and found a few other code snippets using that odd looking throw 0 form. I presume one would catch this as: catch(const int& e) { } Or is this a NULL ptr? to be caught as void* ? Question What does this throw 0 do? Is it special in some way? My normal preference would be to throw something that is (or derived from) std::exception. So to me this looks "bad". Is it "bad" ?

    Read the article

  • number of months between two dates - using boost's date

    - by MartinP
    I've used boost::gregorian::date a bit now. I can see that there are the related months & years & weeks duration types. I can see how to use known durations to advance a given date. Qu: But how can I get the difference between two dates in months (or years or weeks) ? I was hoping to find a function like: template<typename DURATION> DURATION date_diff<DURATION>(const date& d1,const date& d2); There would need to be some handling of rounding too.

    Read the article

1