POV-Ray : Newsgroups : povray.off-topic : Job Interview : Re: Job Interview Server Time
29 Jul 2024 06:19:59 EDT (-0400)
  Re: Job Interview  
From: Le Forgeron
Date: 4 Mar 2012 18:44:32
Message: <4f53fe60$1@news.povray.org>
Le 04/03/2012 23:33, Warp nous fit lire :
>   In C++ in particular this is another situation were the majority of C++
> programmers out there have no idea what's wrong:

* you used a template ? (nop, just a red herring for you! but a single
uppercase letter is usually preferred to Value_t)
* you have the [] checks the upper range (whereas usually it's at()
which check, and [] do not)
* you checked upper range, but not lower one
* you should have stated index in [] with const
* using assert is not the right way to handle the issue.
* you did not test in creator the value of size ( 0 ?)
* copy-constructor... you're in trouble with mData
* you did not disable automatic conversion of "number" into Array<>, so
if you have some different signature for some methods using either
number or Array<>, you're in for surprise (explicit)

With actual compiler:

* you forget the include needed for size_t (cstring)
* you forget the declaration of assert() (assert.h)


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.