Complete.Org: Mailing Lists: Archives: freeciv-dev: May 2004:
[Freeciv-Dev] Re: very simple specvecs
Home

[Freeciv-Dev] Re: very simple specvecs

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: Jason Dorje Short <jdorje@xxxxxxxxxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: very simple specvecs
From: Raimar Falke <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Sun, 16 May 2004 01:57:33 +0200

On Sat, May 15, 2004 at 02:13:50AM -0400, Jason Dorje Short wrote:
> It would be possible to make the specvec a simple array.

>   {
>     foo_vector foo;
> 
>     foo_vector_init(&foo);
>     foo_vector_reserve(&foo, 2);
> 
>     foo[0].a = 1;
>     foo[0].b = 2;
>     foo[1].a = 2;
>     foo[1].b = 4;

With this syntax we loose the ability to do bounds checking.

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
 "Premature optimization is the root of all evil."
    -- D. E. Knuth in "Structured Programming with go to Statements"


[Prev in Thread] Current Thread [Next in Thread]