summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__functional_03
Commit message (Collapse)AuthorAgeFilesLines
* [libc++] Rework compressed pair constructors.Eric Fiselier2019-12-161-4/+4
| | | | | | | | | | | | This patch de-duplicates most compressed pair constructors to use the same code in C++11 and C++03. Part of doing that is deleting the "__second_tag()" and replacing it with a "__value_init_tag()" which has the same effect, but allows for the removal of the special "one-arg" first element constructor. This patch is intended to have no semantic change.
* Update more file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | | to reflect the new license. These used slightly different spellings that defeated my regular expressions. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351648
* [libcxx] func.wrap.func.con: Unset function before destroying anythingVolodymyr Sapsai2018-04-251-20/+36
| | | | | | | | | | | | | | | | | | | | Be defensive against a reentrant std::function::operator=(nullptr_t), in case the held function object has a non-trivial destructor. Destroying the function object in-place can lead to the destructor being called twice. Patch by Duncan P. N. Exon Smith. C++03 support by Volodymyr Sapsai. rdar://problem/32836603 Reviewers: EricWF, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits, arphaman Differential Revision: https://reviews.llvm.org/D34331 llvm-svn: 330885
* Add some const_casts in places where we were implicitly casting away ↵Marshall Clow2017-06-141-4/+4
| | | | | | constness. No functional change, but now they're explicit llvm-svn: 305410
* [NFC] Rename _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VISEric Fiselier2017-01-041-4/+4
| | | | | | | | | | | | | The name _LIBCPP_TYPE_VIS_ONLY is no longer accurate because both _LIBCPP_TYPE_VIS and _LIBCPP_TYPE_VIS_ONLY expand to __attribute__((__type_visibility__)) with Clang. The only remaining difference is that _LIBCPP_TYPE_VIS_ONLY can be applied to templates whereas _LIBCPP_TYPE_VIS cannot (due to dllimport/dllexport not being allowed on templates). This patch renames _LIBCPP_TYPE_VIS_ONLY to _LIBCPP_TEMPLATE_VIS. llvm-svn: 291035
* Fix PR31489 - std::function self-swap segfaultsEric Fiselier2016-12-291-0/+8
| | | | llvm-svn: 290721
* Add an _LIBCPP_NORETURN inline function named __throw_XXX for each exception ↵Marshall Clow2016-08-251-12/+4
| | | | | | type we define. They either construct and throw the exception, or abort() (if exceptions are disabled). Use these functions everywhere instead of assert()ing when exceptions are disabled. WARNING: This is a behavior change - but only with exceptions disabled. Reviewed as: https://reviews.llvm.org/D23855. llvm-svn: 279744
* [libcxx] Fix PR23589: std::function doesn't recognize null pointer to ↵Eric Fiselier2015-08-181-80/+8
| | | | | | | | | | | | | | | | | | | | varargs function. Summary: This patch fixes __not_null's detection of nullptr by breaking it down into 4 cases. 1. `__not_null(Tp const&)`: Default case. Tp is not null. 2. `__not_null(Tp* __ptr);` Case for pointers to functions. 3. `__not_null(_Ret _Class::* __ptr);` Case for pointers to members. 4. `__not_null(function<Tp> const&);`: Cases for other std::functions. Reviewers: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D11111 llvm-svn: 245335
* Merge C++03 and C++11 implementations of mem_fn and __mem_fn.Eric Fiselier2015-07-221-179/+0
| | | | | | | | | | | | | | | | | The implementation of mem_fn doesn't actually require any C++11 support. For some reason there were 17 overloads for mem_fn in C++03 when only one is needed. This patch removes the extra overloads and uses the same implementation of mem_fn in C++03 and C++11. __mem_fn does require variadics to implement the call operator. Instead of having two entirely different implementations of the __mem_fn struct, this patch uses the same __mem_fn struct but provides different call operators when variadics are not available. The only thing left in <__functional_03> is the C++03 implementation of std::function. llvm-svn: 242959
* Cleanup <__functional_03>Eric Fiselier2015-07-221-303/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | <__functional_03> provides the C++03 definitions for std::memfun and std::function. However the interaction between <functional> and <__functional_03> is ugly and duplicates code needlessly. This patch cleans up how the two headers work together. The major changes are: - Provide placeholders, is_bind_expression and is_placeholder in <functional> for both C++03 and C++11. - Provide bad_function_call, function fwd decl, __maybe_derive_from_unary_function and __maybe_derive_from_binary_function in <functional> for both C++03 and C++11. - Move the <__functional_03> include to the bottom of <functional>. This makes it easier to see how <__functional_03> interacts with <functional> - Remove a commented out implementation of bind in C++03. It's never going to get implemented. - Mark almost all std::bind tests as unsupported in C++03. std::is_placeholder works in C++03 and C++11. std::is_bind_expression is provided in C++03 but always returns false. llvm-svn: 242870
* [libcxx] LWG2420 bits for bind<void> - Patch from K-BalloEric Fiselier2015-07-101-2/+4
| | | | | | | Implemented LWG2420 bits for bind<void> Review: http://reviews.llvm.org/D10997 llvm-svn: 241967
* Fix std::function allocator constructors in C++03.Eric Fiselier2015-06-141-12/+20
| | | | | | | | | The C++03 version of function tried to default construct the allocator in the uses allocator constructors when no allocation was performed. These constructors would fail to compile when used with allocators that had no default constructor. llvm-svn: 239708
* Add missing return statements in C++03 std::functionEric Fiselier2015-06-021-0/+4
| | | | llvm-svn: 238803
* In many places, there was an #ifdef/#else block that selected one of two ↵Marshall Clow2015-04-071-28/+4
| | | | | | implmentations of rebind_alloc based on whether or not we had template aliases. Create a helper struct to encapsulate that bit of logic, and replace all the ifdefs with uses of that struct. No functionality change intented. llvm-svn: 234296
* [libcxx] Fix PR 22468 - std::function<void()> does not accept ↵Eric Fiselier2015-02-101-4/+8
| | | | | | | | | | | | | | | | | | | non-void-returning functions Summary: The bug can be found here: http://llvm.org/bugs/show_bug.cgi?id=22468 `__invoke_void_return_wrapper` is needed to properly handle calling a function that returns a value but where the std::function return type is void. Without this '-Wsystem-headers' will cause `function::operator()(...)` to not compile. Reviewers: eugenis, K-ballo, mclow.lists Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7444 llvm-svn: 228705
* Fix libc++ bug #20039: 'Constructing std::function from empty compatible ↵Marshall Clow2014-06-301-4/+9
| | | | | | std::function results in half-empty state' Thanks to Agustin Berge for the report, and for his and Eric Fiselier's work on a fix. llvm-svn: 212070
* Some calls to get<>() were qualified. Some were not. Qualify them all. Fixes ↵Marshall Clow2014-06-241-4/+4
| | | | | | bug #20092. Thanks to Agustín Bergé for the bug report and the fix. llvm-svn: 211563
* Const qualify __mem_fn call operatorPeter Collingbourne2014-01-221-4/+4
| | | | | | | | QOI improvement. Differential Revision: http://llvm-reviews.chandlerc.com/D2059 llvm-svn: 199848
* Nico Rieck: this patch series fixes visibility issues on Windows as ↵Howard Hinnant2013-08-121-7/+7
| | | | | | explained in <http://lists.cs.uiuc.edu/pipermail/cfe-dev/2013-August/031214.html>. llvm-svn: 188192
* Add some missing cv-qualifiers.Richard Smith2013-07-231-24/+24
| | | | llvm-svn: 186909
* No functionality change at this time. I've split _LIBCPP_VISIBLE up into ↵Howard Hinnant2013-03-061-7/+7
| | | | | | two flags: _LIBCPP_TYPE_VIS and _LIBCPP_FUNC_VIS. This is in preparation for taking advantage of clang's new __type_visibility__ attribute. llvm-svn: 176593
* Further macro protection by replacing _[A-Z] with _[A-Z]pHoward Hinnant2011-11-291-610/+610
| | | | llvm-svn: 145410
* Windows support by Ruben Van Boxem.Howard Hinnant2011-10-171-0/+2
| | | | llvm-svn: 142235
* _STD -> _VSTD to avoid macro clash on windowsHoward Hinnant2011-06-301-26/+26
| | | | llvm-svn: 134190
* license changeHoward Hinnant2010-11-161-2/+2
| | | | llvm-svn: 119395
* visibility-decoration.Howard Hinnant2010-09-211-33/+69
| | | | llvm-svn: 114451
* Fixing whitespace problemsHoward Hinnant2010-08-221-39/+38
| | | | llvm-svn: 111750
* Installed allocator into std::functionHoward Hinnant2010-08-201-50/+243
| | | | llvm-svn: 111672
* now works with -fno-exceptions and -fno-rttiHoward Hinnant2010-08-111-0/+64
| | | | llvm-svn: 110828
* Wiped out some non-ascii characters that snuck into the copyright.Howard Hinnant2010-05-111-1/+1
| | | | llvm-svn: 103516
* libcxx initial importHoward Hinnant2010-05-111-0/+1836
llvm-svn: 103490
OpenPOWER on IntegriCloud