comp.lang.ada
 help / color / mirror / Atom feed
From: Victor Porton <porton@narod.ru>
Subject: Why this program does not compile? (iterators)
Date: Fri, 22 Aug 2014 20:18:45 +0300
Date: 2014-08-22T20:18:45+03:00	[thread overview]
Message-ID: <lt7u1i$6bn$1@speranza.aioe.org> (raw)

Why this program does not compile?

gnatgcc -c -g -O2 -gnat2012 -g -O0 -gnato -fstack-check -gnatVa special_test.adb
<built-in>: In function ‘Special_Test’:
<built-in>: error: aggregate value used where an integer was expected

with Ada.Iterator_Interfaces;

procedure Special_Test is

   type My_Description_Cursor is null record;
   
   function Has_Element (Position: My_Description_Cursor) return Boolean is (False);

   package My_Description_Iterators is new Ada.Iterator_Interfaces(My_Description_Cursor, Has_Element);

   type My_Description_Iterator is new My_Description_Iterators.Forward_Iterator with null record;
   
   overriding function First (Object: My_Description_Iterator) return My_Description_Cursor is (null record);
   overriding function Next (Object: My_Description_Iterator; Position: My_Description_Cursor) return My_Description_Cursor is (null record);

   My_Iterator: My_Description_Iterator;

begin
   for C in My_Iterator loop
      null;
   end loop;
end;


-- 
Victor Porton - http://portonvictor.org


             reply	other threads:[~2014-08-22 17:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-22 17:18 Victor Porton [this message]
2014-08-22 23:39 ` Why this program does not compile? (iterators) Randy Brukardt
2014-08-23  4:56   ` Victor Porton
2014-08-23  0:15 ` Egil H H
2014-08-23  0:31   ` Adam Beneschan
2016-04-22 11:14 ` mockturtle
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox