~ubuntu-branches/ubuntu/wily/mp3check/wily

« back to all changes in this revision

Viewing changes to .pc/15-bts667288-gcc-4.7.patch/tmap.h

  • Committer: Package Import Robot
  • Author(s): Sandro Tosi
  • Date: 2012-05-12 16:08:03 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20120512160803-o064g848g3lnvrzc
Tags: 0.8.4-1
* New upstream release
* debian/watch
  - updated
* debian/control
  - added Vcs-{Git, Browser} fields
  - added ${misc:Depends} to Depends line
  - bump Standards-Version to 3.9.3 (no changes needed)
* Converted to 3.0 (quilt) source format
* Converted to debhelper 9 and dh sequencer
* debian/copyright
  - updated to DEP5 and to new upstream release
* debian/patches/20_use_destdir_to_install.patch
  - install using DESTDIR variable
* debian/rules
  - upstream doesn't ship doc anymore
  - install the manpage (no longer done by upstream Makefile)
* debian/patches/15-bts667288-gcc-4.7.patch
  - fix FTBFS with GCC-4.7 (due to uncoordinated upload by gcc "maintainer");
    thanks to Jari Aalto for the patch; Closes: #667288
* debian/patches/30_bts624138_manpage_typo.patch
  - fix a typo in the manpage; thanks to Reuben Thomas for the report;
    Closes: #624138

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*GPL*START*
 
2
 * 
 
3
 * tmap<> class template -- improved stl map<>
 
4
 * 
 
5
 * Copyright (C) 2000-2001 by Johannes Overmann <Johannes.Overmann@gmx.de>
 
6
 * 
 
7
 * This program is free software; you can redistribute it and/or modify
 
8
 * it under the terms of the GNU General Public License as published by
 
9
 * the Free Software Foundation; either version 2 of the License, or
 
10
 * (at your option) any later version.
 
11
 * 
 
12
 * This program is distributed in the hope that it will be useful,
 
13
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 * GNU General Public License for more details.
 
16
 * 
 
17
 * You should have received a copy of the GNU General Public License
 
18
 * along with this program; if not, write to the Free Software
 
19
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
20
 * *GPL*END*/  
 
21
 
 
22
#ifndef _ngw_tmap_h_
 
23
#define _ngw_tmap_h_
 
24
 
 
25
 
 
26
#ifdef DONT_USE_STL
 
27
# include "ttmap.h"
 
28
# define tmap_base ttmap
 
29
#else
 
30
# include <map>
 
31
# define tmap_base map
 
32
using namespace std;
 
33
#endif
 
34
 
 
35
 
 
36
#include "texception.h"
 
37
 
 
38
// history: start 08 Jul 2000
 
39
// 2000:
 
40
// 08 Jul: removing tarray and tassocarray, this should provide tmap and tvector
 
41
// 2001:
 
42
// 15 Sep: DONT_USE_STL feature added
 
43
// 16 Sep: splittet tstl.h into tvector.h and tmap.h
 
44
 
 
45
 
 
46
template<class K, class T>
 
47
class tmap: public tmap_base<K,T> {
 
48
 public:
 
49
   // 1:1 wrapper
 
50
 
 
51
   /// access element (read/write) (this is needed for some strange reason)
 
52
   T& operator[](const K& key) { return tmap_base<K,T>::operator[](key); };
 
53
 
 
54
   // new functionality
 
55
 
 
56
   /// return whether an element with key is contained or not
 
57
    bool contains(const K& key) const { return find(key) != tmap_base<K,T>::end(); }
 
58
   /// access element read only (const)
 
59
// g++ 2.95.2 does not allow this:
 
60
// const T& operator[](const K& key) const { const_iterator i = find(key); if(i != end()) return i->second; else throw TNotFoundException(); } // throw(TNotFoundException)
 
61
   const T& operator[](const K& key) const { if(contains(key)) return find(key)->second; else throw TNotFoundException(); } // throw(TNotFoundException)
 
62
};
 
63
 
 
64
 
 
65
#endif /* _ngw_tmap_h_ */
 
66