RE: [Dev-C++] 'extern const' and std::vector
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Ioannis V. <iv...@at...> - 2003-05-01 16:31:31
|
> -----Original Message-----
> From: dev...@li...=20
> [mailto:dev...@li...] On Behalf=20
> Of David McKen
> Sent: Thursday, May 01, 2003 6:22 PM
> To: dev...@li...
> Subject: Re: [Dev-C++] 'extern const' and std::vector
>=20
>=20
> I see.
>=20
> So const extern is out of the question then. No problem
> just need to
> hope these functions don't try to write to the varible.
Why you would need such a global variable in the first place? It really
sounds like a bad design decision. In any case you can do something =
like:
namespace whatever
{
// Your variable
int x;
inline void write(int y) { x=3Dy; }
inline int read() { return x; }
}
or use a class. In any case I can't understand why you need it to be =
global.
>=20
> Actually 2^32 is the upper limit using the current world
> size we have not
> passed 10000 entries. We have some serious expansion in
> mind thus I am
> planning for some of the heaviest loads. The current
> implementation uses a
> doubly-linked list (links point both to the next entry and
> the previous
> entry).
> As you gan guess this can be problematic when the number of
> entries begins
> to really start growing. Thats why I am looking for
> alternatives.
I assume you need random access?
Ioannis Vranos
=20
* Programming pages: http://www.noicys.freeurl.com
* Alternative URL 1: http://run.to/noicys
* Alternative URL 2: http://www.noicys.cjb.net
Anti-racism movement: http://www.positive-youthfoundation.org
Iraq Peace Pledge: http://www.peacepledge.org
|