1 /* { dg-do compile } */
2 // { dg-timeout-factor 2.0 }
3 // { dg-additional-options "-std=c++11 -fsanitize=undefined -O2 -Wno-return-type" }
7 inline ECoordinate & y ();
9 ECoordinate & EPoint::y () { }
10 template < class KEY, class CONTENT > class AVLTree;
11 template < class KEY, class CONTENT > class AVLTreeNode {
13 AVLTree < KEY, CONTENT >;
15 void set_rthread (unsigned char b);
16 void set_lthread (unsigned char b);
18 template < class KEY, class CONTENT > class AVLTree {
21 void insert (const KEY & key, const CONTENT & c);
22 AVLTreeNode < KEY, CONTENT > *root;
23 const KEY * _target_key;
24 virtual int compare (const KEY & k1, const KEY & k2) const;
25 void _add (AVLTreeNode < KEY, CONTENT > *&t);
26 virtual void _status (unsigned int) { }
28 template < class KEY, class CONTENT > void AVLTree < KEY, CONTENT >::_add (AVLTreeNode < KEY, CONTENT > *&t) {
29 int cmp = compare (*_target_key, t->key);
33 template < class KEY, class CONTENT > void AVLTree < KEY, CONTENT >::insert (const KEY & key, const CONTENT & c) {
35 root->set_rthread (1);
36 root->set_lthread (1);
38 else { _target_key = &key; _add (root); }
40 template < class KEY, class CONTENT > AVLTree < KEY, CONTENT >::AVLTree ()
42 class ContactRepository {
43 void insertContact (EPoint & pt, int val);
45 void ContactRepository::insertContact (EPoint & pt, int val) {
46 AVLTreeNode < ECoordinate, AVLTree < ECoordinate, int >*>*cont_x_node;
47 if (cont_x_node == __null)
49 AVLTree < ECoordinate, int >*insert_tree = new AVLTree < ECoordinate, int >;
50 insert_tree->insert (pt.y (), val);