diff options
| author | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-07 22:26:15 +0000 |
|---|---|---|
| committer | redi <redi@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-11-07 22:26:15 +0000 |
| commit | 33ff7935fdcc6e05789f87c0f10cff1a126b19c0 (patch) | |
| tree | e5214d4cf5b63d66ee5b1c2526c78957454dc230 /libstdc++-v3/include/std/mutex | |
| parent | 6152df278e65fa9e9c60d2a4648dac411bbc3b38 (diff) | |
| download | ppe42-gcc-33ff7935fdcc6e05789f87c0f10cff1a126b19c0.tar.gz ppe42-gcc-33ff7935fdcc6e05789f87c0f10cff1a126b19c0.zip | |
* include/std/mutex (call_once): Store closure in __once_functor
as bound function wrapper might not be copyable.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@181128 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/std/mutex')
| -rw-r--r-- | libstdc++-v3/include/std/mutex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/libstdc++-v3/include/std/mutex b/libstdc++-v3/include/std/mutex index bc2675b2b68..69e26e6de84 100644 --- a/libstdc++-v3/include/std/mutex +++ b/libstdc++-v3/include/std/mutex @@ -810,8 +810,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __once_call = &__once_call_impl<decltype(__bound_functor)>; #else unique_lock<mutex> __functor_lock(__get_once_mutex()); - __once_functor = std::__bind_simple(std::forward<_Callable>(__f), + auto __callable = std::__bind_simple(std::forward<_Callable>(__f), std::forward<_Args>(__args)...); + __once_functor = [&]() { __callable(); }; __set_once_functor_lock_ptr(&__functor_lock); #endif |

