Skip to content
This repository has been archived by the owner on Apr 23, 2020. It is now read-only.

Commit

Permalink
Fixed two problems found by Chris Jefferson: Made operator>> for char…
Browse files Browse the repository at this point in the history
… consistent with gcc. Opened an LWG issue on this one. 2) Renamed some private typedefs which are causing boost grief.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@126576 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
Howard Hinnant committed Feb 27, 2011
1 parent e7c8da6 commit df85e57
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/__hash_table
Expand Up @@ -29,9 +29,9 @@ template <class _NodePtr>
struct __hash_node_base
{
typedef __hash_node_base __first_node;
typedef _NodePtr pointer;
// typedef _NodePtr pointer;

pointer __next_;
_NodePtr __next_;

_LIBCPP_INLINE_VISIBILITY __hash_node_base() : __next_(nullptr) {}
};
Expand Down
8 changes: 8 additions & 0 deletions include/istream
Expand Up @@ -801,6 +801,13 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
typename basic_istream<_CharT, _Traits>::sentry __sen(__is);
if (__sen)
{
#if 1
typename _Traits::int_type __i = __is.rdbuf()->sbumpc();
if (_Traits::eq_int_type(__i, _Traits::eof()))
__is.setstate(ios_base::eofbit | ios_base::failbit);
else
__c = _Traits::to_char_type(__i);
#else
typedef istreambuf_iterator<_CharT, _Traits> _I;
_I __i(__is);
_I __eof;
Expand All @@ -812,6 +819,7 @@ operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c)
}
else
__is.setstate(ios_base::eofbit | ios_base::failbit);
#endif
}
#ifndef _LIBCPP_NO_EXCEPTIONS
}
Expand Down
12 changes: 6 additions & 6 deletions include/map
Expand Up @@ -493,11 +493,11 @@ class _LIBCPP_VISIBLE __map_iterator
_TreeIterator __i_;

typedef typename _TreeIterator::__pointer_traits __pointer_traits;
typedef const typename _TreeIterator::value_type::first_type key_type;
typedef typename _TreeIterator::value_type::second_type mapped_type;
typedef const typename _TreeIterator::value_type::first_type __key_type;
typedef typename _TreeIterator::value_type::second_type __mapped_type;
public:
typedef bidirectional_iterator_tag iterator_category;
typedef pair<key_type, mapped_type> value_type;
typedef pair<__key_type, __mapped_type> value_type;
typedef typename _TreeIterator::difference_type difference_type;
typedef value_type& reference;
typedef typename __pointer_traits::template
Expand Down Expand Up @@ -558,11 +558,11 @@ class _LIBCPP_VISIBLE __map_const_iterator
_TreeIterator __i_;

typedef typename _TreeIterator::__pointer_traits __pointer_traits;
typedef const typename _TreeIterator::value_type::first_type key_type;
typedef typename _TreeIterator::value_type::second_type mapped_type;
typedef const typename _TreeIterator::value_type::first_type __key_type;
typedef typename _TreeIterator::value_type::second_type __mapped_type;
public:
typedef bidirectional_iterator_tag iterator_category;
typedef pair<key_type, mapped_type> value_type;
typedef pair<__key_type, __mapped_type> value_type;
typedef typename _TreeIterator::difference_type difference_type;
typedef const value_type& reference;
typedef typename __pointer_traits::template
Expand Down

0 comments on commit df85e57

Please sign in to comment.