/src/libreoffice/include/o3tl/functional.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * |
4 | | * Copyright (c) 1994 |
5 | | * Hewlett-Packard Company |
6 | | * |
7 | | * Copyright (c) 1996-1998 |
8 | | * Silicon Graphics Computer Systems, Inc. |
9 | | * |
10 | | * Copyright (c) 1997 |
11 | | * Moscow Center for SPARC Technology |
12 | | * |
13 | | * Copyright (c) 1999 |
14 | | * Boris Fomitchev |
15 | | * |
16 | | * This material is provided "as is", with absolutely no warranty expressed |
17 | | * or implied. Any use is at your own risk. |
18 | | * |
19 | | * Permission to use or copy this software for any purpose is hereby granted |
20 | | * without fee, provided the above notices are retained on all copies. |
21 | | * Permission to modify the code and to distribute modified code is granted, |
22 | | * provided the above notices are retained, and a notice that the code was |
23 | | * modified is included with the above copyright notice. |
24 | | * |
25 | | */ |
26 | | |
27 | | /* |
28 | | * Lifted and paraphrased from STLport - with additions from Fridrich |
29 | | * Strba and Thorsten Behrens |
30 | | */ |
31 | | |
32 | | #ifndef INCLUDED_O3TL_FUNCTIONAL_HXX |
33 | | #define INCLUDED_O3TL_FUNCTIONAL_HXX |
34 | | |
35 | | namespace o3tl |
36 | | { |
37 | | /// Select first value of a pair |
38 | | template<typename P> |
39 | | struct select1st |
40 | | { |
41 | | typedef P argument_type; |
42 | | typedef typename P::first_type result_type; |
43 | 0 | const result_type& operator()( const argument_type& cp ) const { |
44 | 0 | return cp.first; |
45 | 0 | } Unexecuted instantiation: ChartTypeManager.cxx:o3tl::select1st<std::__1::pair<rtl::OUString const, (anonymous namespace)::TemplateId> >::operator()(std::__1::pair<rtl::OUString const, (anonymous namespace)::TemplateId> const&) const Unexecuted instantiation: o3tl::select1st<std::__1::pair<chart::ObjectIdentifier const, rtl::Reference<chart::AccessibleBase> > >::operator()(std::__1::pair<chart::ObjectIdentifier const, rtl::Reference<chart::AccessibleBase> > const&) const Unexecuted instantiation: o3tl::select1st<std::__1::pair<rtl::OUString, com::sun::star::uno::Sequence<rtl::OUString> > >::operator()(std::__1::pair<rtl::OUString, com::sun::star::uno::Sequence<rtl::OUString> > const&) const Unexecuted instantiation: o3tl::select1st<std::__1::pair<int, std::__1::unique_ptr<connectivity::OKeyValue, std::__1::default_delete<connectivity::OKeyValue> > > >::operator()(std::__1::pair<int, std::__1::unique_ptr<connectivity::OKeyValue, std::__1::default_delete<connectivity::OKeyValue> > > const&) const |
46 | | }; |
47 | | |
48 | | /// Select second value of a pair |
49 | | template<typename P> |
50 | | struct select2nd |
51 | | { |
52 | | typedef P argument_type; |
53 | | typedef typename P::second_type result_type; |
54 | 281k | const result_type& operator()( const argument_type& cp ) const { |
55 | 281k | return cp.second; |
56 | 281k | } |
57 | | }; |
58 | | |
59 | | } // namespace o3tl |
60 | | |
61 | | #endif |
62 | | |
63 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |