xref: /dflybsd-src/contrib/gcc-8.0/libstdc++-v3/src/c++11/string-inst.cc (revision 95059079af47f9a66a175f374f2da1a5020e3255)
138fd1498Szrj // Components for manipulating sequences of characters -*- C++ -*-
238fd1498Szrj 
338fd1498Szrj // Copyright (C) 1997-2018 Free Software Foundation, Inc.
438fd1498Szrj //
538fd1498Szrj // This file is part of the GNU ISO C++ Library.  This library is free
638fd1498Szrj // software; you can redistribute it and/or modify it under the
738fd1498Szrj // terms of the GNU General Public License as published by the
838fd1498Szrj // Free Software Foundation; either version 3, or (at your option)
938fd1498Szrj // any later version.
1038fd1498Szrj 
1138fd1498Szrj // This library is distributed in the hope that it will be useful,
1238fd1498Szrj // but WITHOUT ANY WARRANTY; without even the implied warranty of
1338fd1498Szrj // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1438fd1498Szrj // GNU General Public License for more details.
1538fd1498Szrj 
1638fd1498Szrj // Under Section 7 of GPL version 3, you are granted additional
1738fd1498Szrj // permissions described in the GCC Runtime Library Exception, version
1838fd1498Szrj // 3.1, as published by the Free Software Foundation.
1938fd1498Szrj 
2038fd1498Szrj // You should have received a copy of the GNU General Public License and
2138fd1498Szrj // a copy of the GCC Runtime Library Exception along with this program;
2238fd1498Szrj // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
2338fd1498Szrj // <http://www.gnu.org/licenses/>.
2438fd1498Szrj 
2538fd1498Szrj //
2638fd1498Szrj // ISO C++ 14882: 21  Strings library
2738fd1498Szrj //
2838fd1498Szrj 
2938fd1498Szrj // Written by Jason Merrill based upon the specification by Takanori Adachi
3038fd1498Szrj // in ANSI X3J16/94-0013R2.  Rewritten by Nathan Myers.
3138fd1498Szrj 
3238fd1498Szrj #ifndef _GLIBCXX_USE_CXX11_ABI
3338fd1498Szrj // Instantiations in this file use the new SSO std::string ABI unless included
3438fd1498Szrj // by another file which defines _GLIBCXX_USE_CXX11_ABI=0.
3538fd1498Szrj # define _GLIBCXX_USE_CXX11_ABI 1
3638fd1498Szrj #endif
3738fd1498Szrj 
38*58e805e6Szrj // Prevent the basic_string(const _CharT*, const _Alloc&) and
39*58e805e6Szrj // basic_string(size_type, _CharT, const _Alloc&) constructors from being
40*58e805e6Szrj // replaced by constrained function templates, so that we instantiate the
41*58e805e6Szrj // pre-C++17 definitions.
42*58e805e6Szrj #define _GLIBCXX_DEFINING_STRING_INSTANTIATIONS 1
43*58e805e6Szrj 
4438fd1498Szrj #include <string>
4538fd1498Szrj 
4638fd1498Szrj // Instantiation configuration.
4738fd1498Szrj #ifndef C
4838fd1498Szrj # define C char
4938fd1498Szrj #endif
5038fd1498Szrj 
5138fd1498Szrj namespace std _GLIBCXX_VISIBILITY(default)
5238fd1498Szrj {
5338fd1498Szrj _GLIBCXX_BEGIN_NAMESPACE_VERSION
5438fd1498Szrj 
5538fd1498Szrj   typedef basic_string<C> S;
5638fd1498Szrj 
5738fd1498Szrj   template class basic_string<C>;
5838fd1498Szrj   template S operator+(const C*, const S&);
5938fd1498Szrj   template S operator+(C, const S&);
6038fd1498Szrj   template S operator+(const S&, const S&);
6138fd1498Szrj 
6238fd1498Szrj   // Only one template keyword allowed here.
6338fd1498Szrj   // See core issue #46 (NAD)
6438fd1498Szrj   // http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_closed.html#46
6538fd1498Szrj   template
6638fd1498Szrj     S::basic_string(C*, C*, const allocator<C>&);
6738fd1498Szrj 
6838fd1498Szrj   template
6938fd1498Szrj     S::basic_string(const C*, const C*, const allocator<C>&);
7038fd1498Szrj 
7138fd1498Szrj   template
7238fd1498Szrj     S::basic_string(S::iterator, S::iterator, const allocator<C>&);
7338fd1498Szrj 
7438fd1498Szrj #if _GLIBCXX_USE_CXX11_ABI
7538fd1498Szrj   template
7638fd1498Szrj     void
7738fd1498Szrj     S::_M_construct(S::iterator, S::iterator, forward_iterator_tag);
7838fd1498Szrj 
7938fd1498Szrj   template
8038fd1498Szrj     void
8138fd1498Szrj     S::_M_construct(S::const_iterator, S::const_iterator,
8238fd1498Szrj 		    forward_iterator_tag);
8338fd1498Szrj 
8438fd1498Szrj   template
8538fd1498Szrj     void
8638fd1498Szrj     S::_M_construct(C*, C*, forward_iterator_tag);
8738fd1498Szrj 
8838fd1498Szrj   template
8938fd1498Szrj     void
9038fd1498Szrj     S::_M_construct(const C*, const C*, forward_iterator_tag);
9138fd1498Szrj 
9238fd1498Szrj #else // !_GLIBCXX_USE_CXX11_ABI
9338fd1498Szrj 
9438fd1498Szrj   template
9538fd1498Szrj     C*
9638fd1498Szrj     S::_S_construct(S::iterator, S::iterator,
9738fd1498Szrj 		    const allocator<C>&, forward_iterator_tag);
9838fd1498Szrj 
9938fd1498Szrj   template
10038fd1498Szrj     C*
10138fd1498Szrj     S::_S_construct(C*, C*, const allocator<C>&, forward_iterator_tag);
10238fd1498Szrj 
10338fd1498Szrj   template
10438fd1498Szrj     C*
10538fd1498Szrj     S::_S_construct(const C*, const C*, const allocator<C>&,
10638fd1498Szrj 		    forward_iterator_tag);
10738fd1498Szrj #endif
10838fd1498Szrj 
10938fd1498Szrj _GLIBCXX_END_NAMESPACE_VERSION
11038fd1498Szrj } // namespace
11138fd1498Szrj 
11238fd1498Szrj namespace __gnu_cxx _GLIBCXX_VISIBILITY(default)
11338fd1498Szrj {
11438fd1498Szrj _GLIBCXX_BEGIN_NAMESPACE_VERSION
11538fd1498Szrj 
11638fd1498Szrj   using std::S;
11738fd1498Szrj   template bool operator==(const S::iterator&, const S::iterator&);
11838fd1498Szrj   template bool operator==(const S::const_iterator&, const S::const_iterator&);
11938fd1498Szrj 
12038fd1498Szrj _GLIBCXX_END_NAMESPACE_VERSION
12138fd1498Szrj } // namespace
122