1
2
3
4
5
6 using System.Concepts;
7
8 namespace System
9 {
10 public class FrontInsertProxy<C> where C is FrontInsertionSequence
11 {
12 private typedef FrontInsertProxy<C> Self;
13 private typedef C.ValueType ValueType;
14
15 public inline nothrow FrontInsertProxy() : c(null)
16 {
17 }
18 public inline explicit nothrow FrontInsertProxy(C* c_) : c(c_)
19 {
20 }
21 public inline void operator=(const ValueType& value)
22 {
23 c->InsertFront(value);
24 }
25 private C* c;
26 }
27
28 public class FrontInsertIterator<C> where C is FrontInsertionSequence
29 {
30 private typedef FrontInsertIterator<C> Self;
31 private typedef FrontInsertProxy<C> Proxy;
32 public typedef C.ValueType ValueType;
33 public typedef Proxy& ReferenceType;
34 public typedef Proxy* PointerType;
35
36 public inline nothrow FrontInsertIterator() : proxy()
37 {
38 }
39 public inline nothrow FrontInsertIterator(C& c) : proxy(&c)
40 {
41 }
42 public inline nothrow ReferenceType operator*()
43 {
44 return proxy;
45 }
46 public inline nothrow PointerType operator->()
47 {
48 return &proxy;
49 }
50 public inline nothrow Self& operator++()
51 {
52 return *this;
53 }
54 private Proxy proxy;
55 }
56
57 public nothrow FrontInsertIterator<C> FrontInserter<C>(C& c) where C is FrontInsertionSequence
58 {
59 return FrontInsertIterator<C>(c);
60 }
61 }