Opened 10 years ago

Closed 10 years ago

Last modified 8 years ago

#9725 closed build error (fixed)

Compile error in tests/hashes/hashes.cpp

Reported by: Peter_Most Owned by:
Priority: low Milestone:
Component: build Version: stable-latest
Keywords: Cc: Peter_Most@…
Blocked By: Blocking:
Patch: yes


When trying to compile the unit tests I'm getting compiler errors:

../../tests/hashes/hashes.cpp: In function ‘void HashMapTest() [with HashMapT = std::tr1::unordered_map<wxString, wxString, wxStringHash, wxStringEqual, std::allocator<std::pair<const wxString, 
wxString> >, false>]’:
../../tests/hashes/hashes.cpp:462:   instantiated from here
../../tests/hashes/hashes.cpp:386: error: no type named ‘t2’ in ‘struct std::pair<const wxString, wxString>’

These are coming from:

template <class HashMapT>
void HashMapTest()
#if wxUSE_STL && defined HAVE_STL_HASH_MAP
    typedef typename HashMapT::value_type::second_type value_type;
    typedef typename HashMapT::value_type::t2 value_type;
    typedef typename HashMapT::key_type key_type;
    typedef typename HashMapT::iterator Itor;

The line:

typedef typename HashMapT::value_type::t2 value_type;

probably exists to support the generated pair type with _WX_DECLARE_PAIR

Attachments (1)

ticket_9725.patch download (981 bytes) - added by Peter Most 10 years ago.
Changed _WX_DECLARE_PAIR and removed check in tests/hashes/hashes.cpp

Download all attachments as: .zip

Change History (5)

comment:1 Changed 10 years ago by Peter Most

  • Patch set

As discussed on the mailing list, the macro _WX_DECLARE_PAIR will be changed to be more similar to std::pair. With these changes the check in tests/hashes/hashes.cpp

#if wxUSE_STL && defined HAVE_STL_HASH_MAP

can also be removed.

Changed 10 years ago by Peter Most

Changed _WX_DECLARE_PAIR and removed check in tests/hashes/hashes.cpp

comment:2 Changed 10 years ago by vadz

  • Resolution set to fixed
  • Status changed from new to closed

I don't think you can remove the existing t1 and t2 types, they're used at least by wx code itself. And it's possible (although unlikely) that they're used in user code too.

OTOH we can just add more typedefs without changing the existing ones, this is what I did in r54609, thanks.

comment:3 Changed 10 years ago by Peter Most

  • Cc Peter_Most@… added

comment:4 Changed 8 years ago by wxsite

  • Reporter changed from Peter Most to Peter_Most
Note: See TracTickets for help on using tickets.