xref: /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/libsupc++/tinfo2.cc (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg // Methods for type_info for -*- C++ -*- Run Time Type Identification.
21debfc3dSmrg 
3*8feb0f0bSmrg // Copyright (C) 1994-2020 Free Software Foundation, Inc.
41debfc3dSmrg //
51debfc3dSmrg // This file is part of GCC.
61debfc3dSmrg //
71debfc3dSmrg // GCC is free software; you can redistribute it and/or modify
81debfc3dSmrg // it under the terms of the GNU General Public License as published by
91debfc3dSmrg // the Free Software Foundation; either version 3, or (at your option)
101debfc3dSmrg // any later version.
111debfc3dSmrg 
121debfc3dSmrg // GCC is distributed in the hope that it will be useful,
131debfc3dSmrg // but WITHOUT ANY WARRANTY; without even the implied warranty of
141debfc3dSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
151debfc3dSmrg // GNU General Public License for more details.
161debfc3dSmrg 
171debfc3dSmrg // Under Section 7 of GPL version 3, you are granted additional
181debfc3dSmrg // permissions described in the GCC Runtime Library Exception, version
191debfc3dSmrg // 3.1, as published by the Free Software Foundation.
201debfc3dSmrg 
211debfc3dSmrg // You should have received a copy of the GNU General Public License and
221debfc3dSmrg // a copy of the GCC Runtime Library Exception along with this program;
231debfc3dSmrg // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
241debfc3dSmrg // <http://www.gnu.org/licenses/>.
251debfc3dSmrg 
261debfc3dSmrg #include <cstddef>
271debfc3dSmrg #include "tinfo.h"
281debfc3dSmrg 
291debfc3dSmrg using std::type_info;
301debfc3dSmrg 
311debfc3dSmrg #if !__GXX_TYPEINFO_EQUALITY_INLINE
321debfc3dSmrg 
331debfc3dSmrg bool
before(const type_info & arg) const341debfc3dSmrg type_info::before (const type_info &arg) const _GLIBCXX_NOEXCEPT
351debfc3dSmrg {
361debfc3dSmrg #if __GXX_MERGED_TYPEINFO_NAMES
371debfc3dSmrg   return name () < arg.name ();
381debfc3dSmrg #else
391debfc3dSmrg   return (name ()[0] == '*') ? name () < arg.name ()
401debfc3dSmrg     :  __builtin_strcmp (name (), arg.name ()) < 0;
411debfc3dSmrg #endif
421debfc3dSmrg }
431debfc3dSmrg 
441debfc3dSmrg #endif
45