Re: memory management in Ada: tedious without GC?



Maciej,

Sorry for being a bit rude, but OP explicitly said that this is not
for those who use the names C and C++ interchangeably. :-)

Sorry for being a bit rude but...

float norm(const vector<float> & v);

// and then:
vector<float> v(100);

is simpler written as:

float v[100];

and the point was about a constraint not known at compile time.

AFAIK

int N;

N = <value computed at runtime>;

vector<float> v(N);

Is not C++. And this was only a simple example for the OP. I'm talking about all objects whose constraint are not known at compile time.

Pascal.

--

--|------------------------------------------------------
--| Pascal Obry Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--| http://www.obry.net
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver wwwkeys.pgp.net --recv-key C1082595
.



Relevant Pages

  • Re: generics - constraint
    ... a float or a double: ... 'int' is not a valid constraint. ... a non-sealed class or a type parameter. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: predicate, constraints, header, relvar, and relation
    ... I think the property concept works better than the constraint concept. ... It occurs to me that a garden variety type system is ... then passing the compile time checks is a *universally ...
    (comp.databases.theory)
  • Re: Using Delphi 2006 to target .NET 2.0
    ... The same way compliance to an interface or class is resolved. ... constraint) will be done at compile time. ... have the methods defined in the constraint for MyList. ... MyType is not an interface, ...
    (borland.public.delphi.non-technical)
  • Re: what are keys and surrogates?
    ... specify a constraint on a variable, ... I see that as part and parcel of the important idea of compile time ... Consider that int64, ... we would want int16 to be a subtype of int32 which is a subtype ...
    (comp.databases.theory)
  • Re: Is the following expression undefined behavior ?
    ... The relevant wording in C89 is, ... No, it's not a constraint, since it's not marked as one. ... Constraint violations must be diagnosed at compile time, ... It's not possible to determine at compile time whether *p1 and *p2 are ...
    (comp.lang.c)

Loading