This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[v3] wint_t visibility, string instantiation cleanups



do the wint_t thing for cwctype that was just done for size_t.

simplify string instantiations by doing the whole class, not piecemeal.

tested on x86/linux w/ and w/o wide-character support.

2001-01-03  Benjamin Kosnik  <bkoz@redhat.com>

	* include/c_std/bits/std_cwctype.h: Include std_cwchar.h for wint_t.
	* testsuite/17_intro/header_cwctype.cc (main): New file.

	* src/Makefile.am (base_headers): Change.
	* include/bits/std_string.h: And here.
	* include/bits/string.tcc: Tweaks, move to...
	* include/bits/basic_string.tcc: ...Here.
	* src/string-inst.cc: Simplify, just instantiate the whole class,
	not member-by-member.

Index: include/c_std/bits/std_cwctype.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/c_std/bits/std_cwctype.h,v
retrieving revision 1.3
diff -c -p -r1.3 std_cwctype.h
*** std_cwctype.h	2000/12/22 00:27:01	1.3
--- std_cwctype.h	2001/01/04 04:20:21
***************
*** 1,6 ****
  // -*- C++ -*- forwarding header.
  
! // Copyright (C) 1997-1999, 2000 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
--- 1,6 ----
  // -*- C++ -*- forwarding header.
  
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
***************
*** 35,40 ****
--- 35,42 ----
  
  #ifndef _CPP_CWCTYPE
  #define _CPP_CWCTYPE 1
+ 
+ #include <bits/std_cwchar.h>
  
  #pragma GCC system_header
  #include <wctype.h>
Index: src/Makefile.am
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/Makefile.am,v
retrieving revision 1.61
diff -c -p -r1.61 Makefile.am
*** Makefile.am	2000/12/23 07:13:57	1.61
--- Makefile.am	2001/01/04 04:20:24
*************** INCLUDES = \
*** 76,82 ****
  
  base_headers = \
  	bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
! 	bits/basic_string.h bits/std_string.h  bits/string.tcc \
  	bits/generic_shadow.h bits/std_utility.h \
  	bits/std_complex.h \
  	bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
--- 76,82 ----
  
  base_headers = \
  	bits/cpp_type_traits.h bits/char_traits.h bits/codecvt.h \
! 	bits/std_string.h bits/basic_string.h bits/basic_string.tcc \
  	bits/generic_shadow.h bits/std_utility.h \
  	bits/std_complex.h \
  	bits/valarray_array.h bits/valarray_array.tcc bits/valarray_meta.h \
Index: src/string-inst.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/string-inst.cc,v
retrieving revision 1.11
diff -c -p -r1.11 string-inst.cc
*** string-inst.cc	2000/12/23 07:13:57	1.11
--- string-inst.cc	2001/01/04 04:20:24
***************
*** 1,6 ****
  // Components for manipulating sequences of characters -*- C++ -*-
  
! // Copyright (C) 2000, 1999, 1998, 1997 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
--- 1,6 ----
  // Components for manipulating sequences of characters -*- C++ -*-
  
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
***************
*** 35,251 ****
  // in ANSI X3J16/94-0013R2.  Rewritten by Nathan Myers.
  
  #include <bits/std_string.h>
- #include <bits/std_algorithm.h>
  
  // Instantiation configuration.
  #ifndef C
  # define C char
- # define _GLIBCPP_INSTANTIATING_CHAR 1
  #endif
  
  namespace std 
  {
    typedef basic_string<C> S;
  
!   template C S::_Rep::_S_terminal;
!   template const S::size_type S::npos;
!   template S::size_type S::_Rep::_S_max_size;
!   template S::size_type S::_S_empty_rep_storage[];
!   template S::_Rep* S::_Rep::_S_create(size_t, S::allocator_type const&);
!   template void S::_Rep::_M_destroy(const S::allocator_type&) throw();
!   template void __destroy_aux(S*, S*, __false_type);
  
!   template S::basic_string(S const&);
! 
!   template 
!     S::basic_string(S::size_type, C, const S::allocator_type&);
! 
!   template 
!     S::basic_string(const S::allocator_type&);
! 
!   template 
!     S::basic_string(const S&, S::size_type, S::size_type);
! 
!   template 
!     S::basic_string(const S&, S::size_type, S::size_type, 
! 		    const S::allocator_type&);
! 
!   template 
!     S::basic_string(C const*, S::size_type, const S::allocator_type&);
! 
!   template 
!     S::basic_string(C const*, S::allocator_type const&);
! 
!   template 
!     S::basic_string(C*, C*, const allocator<C>&);
! 
!   template 
!     S::basic_string(S::iterator, S::iterator, const allocator<C>&);
! 
!   template
!     void S::_M_leak_hard();
! 
!   template
!     void S::_M_mutate(S::size_type, S::size_type, S::size_type);
! 
!   template
!     C* S::_Rep::_M_clone(S::allocator_type const&, S::size_type);
! 
!   template
!     void S::reserve(S::size_type);
! 
!   template
!     void S::swap(S&);
! 
! # ifdef _GLIBCPP_ALLOC_CONTROL
!     template
!       bool (* S::_Rep::_S_excess_slop)(size_t, size_t); 
! 
!     template
!       bool S::_Rep::_S_default_excess(size_t, size_t); 
! # endif
! 
!   template
!     void S::resize(S::size_type, C);
! 
!   template
!     S& S::append(S const&);
! 
!   template
!     S& S::append(S const&, S::size_type, S::size_type);
! 
!   template
!     S& S::append(C const*, S::size_type);
! 
!   template
!     S& S::append(S::size_type, C);
! 
!   template 
!     S& 
!     S::append<S::iterator>(S::iterator, S::iterator);
! 
!   template
!     S& 
!     S::assign(S const&);
! 
!   template 
!     S& 
!     S::assign<S::iterator>(S::iterator, S::iterator);
! 
!   template 
!     void
!     S::insert<S::iterator> //c*
!     (S::iterator, S::iterator, S::iterator); //it, c+, c+ and temptype = char*
! 
!   template
!     S& S::replace(S::size_type, S::size_type, S const&, 
! 		  S::size_type, S::size_type);
! 
!   template 
!     S& S::replace(S::iterator, S::iterator, S::size_type, C);
! 
!   template 
!     S&
!     S::replace<S::iterator> // c*
!     (S::iterator, S::iterator, S::iterator, S::iterator); //it, it, c+, c+ 
  
    template 
      S& 
      S::_M_replace<S::iterator>
      (S::iterator, S::iterator, S::iterator, S::iterator, forward_iterator_tag);
  
-   // Only one template keyword allowed here. 
-   // See core issue #46 (NAD)
-   // http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#46
    template 
      S& 
      S::_M_replace<S::const_iterator>
      (S::iterator, S::iterator, 
       S::const_iterator, S::const_iterator, forward_iterator_tag);
  
-   template 
-     S& 
-     S::_M_replace<C*>
-     (S::iterator, S::iterator, C*, C*, forward_iterator_tag);
- 
    template 
!     S& 
!     S::_M_replace<const C*>
!     (S::iterator, S::iterator, const C*, const C*, forward_iterator_tag);
! 
!   template
!     S::size_type S::copy(C*, S::size_type, S::size_type) const;
! 
!   template 
!     C* S::_S_construct<S::iterator>(S::iterator, S::iterator, 
! 				    const allocator<C>&);
! 
!   template 
!     C* S::_S_construct<S::iterator>(S::iterator, S::iterator, 
! 				    const allocator<C>&, forward_iterator_tag);
  
    template 
!     C* S::_S_construct<C*>(C*, C*, const allocator<C>&, forward_iterator_tag);
! 
!   template 
!     C* S::_S_construct<const C*>(const C*, const C*, const allocator<C>&, 
! 				 forward_iterator_tag);
! 
!   template 
!     C* S::_S_construct(S::size_type, C, S::allocator_type const&);
! 
!   template
!     const C* S::_S_find(const C* __beg, const C* __end, C __c);
! 
!   template
!     S::size_type S::find(C, S::size_type) const;
! 
!   template
!     S::size_type S::rfind(C const*, S::size_type, S::size_type) const;
! 
!   template
!     S::size_type S::rfind(C, S::size_type) const;
! 
!   template
!     S::size_type S::find_first_of(C const*, S::size_type, S::size_type) const;
! 
!   template
!     S::size_type S::find_last_of(C const*, S::size_type, S::size_type) const;
! 
!   template
!     S::size_type 
!     S::find_first_not_of(C const*, S::size_type, S::size_type) const;
! 
!   template
!     S::size_type 
!     S::find_last_not_of(C const*, S::size_type, S::size_type) const;
! 
!   template
!     S::size_type S::find_last_not_of(C, S::size_type) const;
! 
!   template
!     int S::compare(S::size_type, S::size_type, S const&) const;
! 
!   template
!     int S::compare(S::size_type, S::size_type, S const&, S::size_type, 
! 		   S::size_type) const;
! 
!   template
!     int S::compare(C const*) const;
! 
!   template
!     int S::compare(S::size_type, S::size_type, C const*, S::size_type) const;
! 
!   template S operator+(const C*, const S&);
! 
!   template S operator+(C, const S&);
! 
!   template bool operator==(const S::iterator&, const S::iterator&);
!   template bool operator==(const S::const_iterator&, const S::const_iterator&);
! 
!   template void _S_string_copy(const S&, C*, allocator<C>::size_type);
! 
! } // std
  
  
  
--- 35,79 ----
  // in ANSI X3J16/94-0013R2.  Rewritten by Nathan Myers.
  
  #include <bits/std_string.h>
  
  // Instantiation configuration.
  #ifndef C
  # define C char
  #endif
  
  namespace std 
  {
    typedef basic_string<C> S;
  
!   template class basic_string<C>;
  
!   template S operator+(const C*, const S&);
!   template S operator+(C, const S&);
!   template bool operator==(const S::iterator&, const S::iterator&);
!   template bool operator==(const S::const_iterator&, const S::const_iterator&);
  
+   // Only one template keyword allowed here. 
+   // See core issue #46 (NAD)
+   // http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#46
    template 
      S& 
      S::_M_replace<S::iterator>
      (S::iterator, S::iterator, S::iterator, S::iterator, forward_iterator_tag);
  
    template 
      S& 
      S::_M_replace<S::const_iterator>
      (S::iterator, S::iterator, 
       S::const_iterator, S::const_iterator, forward_iterator_tag);
  
    template 
!     C* 
!     S::_S_construct<S::iterator>
!     (S::iterator, S::iterator, const allocator<C>&, forward_iterator_tag);
  
    template 
!     S::basic_string(S::iterator, S::iterator, const allocator<C>&);
! } // namespace std
  
  
  
Index: include/bits/std_string.h
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/include/bits/std_string.h,v
retrieving revision 1.1
diff -c -p -r1.1 std_string.h
*** std_string.h	2000/10/05 11:27:01	1.1
--- std_string.h	2001/01/04 04:20:24
***************
*** 1,6 ****
  // Components for manipulating sequences of characters -*- C++ -*-
  
! // Copyright (C) 1997-1999 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
--- 1,6 ----
  // Components for manipulating sequences of characters -*- C++ -*-
  
! // Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
  //
  // This file is part of the GNU ISO C++ Library.  This library is free
  // software; you can redistribute it and/or modify it under the
***************
*** 44,50 ****
  
  #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
  # include <bits/std_algorithm.h> // for find_if
! # include <bits/string.tcc> 
  #endif
  
  #endif /* _CPP_STRING */
--- 44,50 ----
  
  #ifdef _GLIBCPP_NO_TEMPLATE_EXPORT
  # include <bits/std_algorithm.h> // for find_if
! # include <bits/basic_string.tcc> 
  #endif
  
  #endif /* _CPP_STRING */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]