comp.lang.ada
 help / color / mirror / Atom feed
* Why this program does not compile? (iterators)
@ 2014-08-22 17:18 Victor Porton
  2014-08-22 23:39 ` Randy Brukardt
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Victor Porton @ 2014-08-22 17:18 UTC (permalink / 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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-04-22 11:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22 17:18 Why this program does not compile? (iterators) Victor Porton
2014-08-22 23:39 ` 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

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