Standard compliant custom allocator

Is OK to throw an exception when 0 is passed to allocate method?

Thank you.

P.S.

If n == 0, the return value is unspecified.

Does it mean that allocate shouldn't throw an exception? I am inclined to think that if throwing wasn't allowed for n==0, then the standard would clearly spell it out.

7
задан pic11 20 May 2011 в 07:44
поделиться