This isn’t the right place for a reference wrapper. A simple pointer suffices, though, and achieves the desired result:
std::thread t1(&A::foo, &a, 100);
More Related Contents:
- How to enforce move semantics when a vector grows?
- Using generic std::function objects with member functions in one class
- Move capture in lambda
- Reusing a moved container?
- ‘colon’ and ‘auto’ in for loop c++? need some help understanding the syntax
- Computing length of a C string at compile time. Is this really a constexpr?
- Detecting constexpr with SFINAE
- Constexpr Math Functions
- Does moving leave the object in a usable state?
- Copy constructor is not inherited
- C++11 lambda implementation and memory model
- Is it possible to “store” a template parameter pack without expanding it?
- How to construct std::array object with initializer list? [duplicate]
- C++11: Compile Time Calculation of Array
- Is it possible to initialize std::vector over already allocated memory?
- Why do auto and template type deduction differ for braced initializers?
- What is the meaning of auto when using C++ trailing return type?
- Does this code from “The C++ Programming Language” 4th edition section 36.3.6 have well-defined behavior?
- C++11 range based loop: How does it really work
- Range based for-loop on array passed to non-main function
- std::function and std::bind: what are they, and when should they be used?
- constexpr vs. static const: Which one to prefer?
- What is the difference between std::quick_exit and std::abort and why was std::quick_exit needed?
- Can nullptr be emulated in gcc?
- Does auto deduce the type at compile time or runtime in C++ 11?
- stl container with std::unique_ptr’s vs boost::ptr_container
- Specialized template function with deleted “general” case fails to compile with g++
- Does C++11 unique_ptr and shared_ptr able to convert to each other’s type?
- Proper way to receive a lambda as parameter by reference
- When to use functors over lambdas