Error static assertion failed std thread arguments must be invocable after conversion to rvalues

I’m clueless on whats going on here

Issue

I’m clueless on whats going on here

here is a simple code example of what I’m trying to achieve:

main.cpp

#include <iostream>
#include <thread>

int main(int argc, char** argv) {

    constexpr int SIZE = 10;

    std::array<int, SIZE> arr{0};

    auto add = []<typename T>(std::array<T, SIZE>& arr) {
        for (int i = 0; i < SIZE; i++)
            arr[i] = i + 1;
    };

    std::thread t1(std::ref(add), std::ref(arr));
    t1.join();

    return 0;
}

compile command:

g++ -std=c++20 -Wall main.cpp -pthread -o t1

error:

In file included from /usr/include/c++/11.1.0/stop_token:35,
                 from /usr/include/c++/11.1.0/thread:40,
                 from main.cpp:2:
/usr/include/c++/11.1.0/bits/std_thread.h: In instantiation of ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >; _Args = {std::reference_wrapper<std::array<int, 10> >}; <template-parameter-1-3> = void]’:
main.cpp:15:48:   required from here
/usr/include/c++/11.1.0/bits/std_thread.h:130:72: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
  130 |                                       typename decay<_Args>::type...>::value,
      |                                                                        ^~~~~
/usr/include/c++/11.1.0/bits/std_thread.h:130:72: note: ‘std::integral_constant<bool, false>::value’ evaluates to false
/usr/include/c++/11.1.0/bits/std_thread.h: In instantiation of ‘struct std::thread::_Invoker<std::tuple<std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >, std::reference_wrapper<std::array<int, 10> > > >’:
/usr/include/c++/11.1.0/bits/std_thread.h:203:13:   required from ‘struct std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >, std::reference_wrapper<std::array<int, 10> > > > >’
/usr/include/c++/11.1.0/bits/std_thread.h:143:29:   required from ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >; _Args = {std::reference_wrapper<std::array<int, 10> >}; <template-parameter-1-3> = void]’
main.cpp:15:48:   required from here
/usr/include/c++/11.1.0/bits/std_thread.h:252:11: error: no type named ‘type’ in ‘struct std::thread::_Invoker<std::tuple<std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >, std::reference_wrapper<std::array<int, 10> > > >::__result<std::tuple<std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >, std::reference_wrapper<std::array<int, 10> > > >’
  252 |           _M_invoke(_Index_tuple<_Ind...>)
      |           ^~~~~~~~~
/usr/include/c++/11.1.0/bits/std_thread.h:256:9: error: no type named ‘type’ in ‘struct std::thread::_Invoker<std::tuple<std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >, std::reference_wrapper<std::array<int, 10> > > >::__result<std::tuple<std::reference_wrapper<main(int, char**)::<lambda(std::array<T, 10>&)> >, std::reference_wrapper<std::array<int, 10> > > >’
  256 |         operator()()
      |         ^~~~~~~~

note:

if I change the lambda to:

auto add = []<typename T>(std::array<T, SIZE> arr)

and call the thread like this:

std::thread t1(std::ref(add), arr);

it compiles, but obviously the array doesn’t changed because its a copy and not a reference

Solution

std::reference_wrapper is not a std::array, so T cannot be deduced.

add(std::ref(arr)); doesn’t compile neither.

You might use

std::thread t1([&](auto arg){ add(arg.get()); }, std::ref(arr));

Demo

Answered By – Jarod42

Answer Checked By – Marilyn (BugsFixing Volunteer)


I am trying to create 2 threads, that work with float arrays. Howere compiler gives me these errors:

/usr/include/c++/9/thread: In instantiation of ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(bool*, float*, float*, float*); _Args = {bool*, float (*)[10], float (*)[10], float (*)[10]}; <template-parameter-1-3> = void]’:
main.cpp:16:66:   required from here
/usr/include/c++/9/thread:120:44: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
  120 |           typename decay<_Args>::type...>::value,
      |                                            ^~~~~
/usr/include/c++/9/thread: In instantiation of ‘struct std::thread::_Invoker<std::tuple<void (*)(bool*, float*, float*, float*), bool*, float (*)[10], float (*)[10], float (*)[10]> >’:
/usr/include/c++/9/thread:131:22:   required from ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(bool*, float*, float*, float*); _Args = {bool*, float (*)[10], float (*)[10], float (*)[10]}; <template-parameter-1-3> = void]’
main.cpp:16:66:   required from here
/usr/include/c++/9/thread:243:4: error: no type named ‘type’ in ‘struct std::thread::_Invoker<std::tuple<void (*)(bool*, float*, float*, float*), bool*, float (*)[10], float (*)[10], float (*)[10]> >::__result<std::tuple<void (*)(bool*, float*, float*, float*), bool*, float (*)[10], float (*)[10], float (*)[10]> >’
  243 |    _M_invoke(_Index_tuple<_Ind...>)
      |    ^~~~~~~~~
/usr/include/c++/9/thread:247:2: error: no type named ‘type’ in ‘struct std::thread::_Invoker<std::tuple<void (*)(bool*, float*, float*, float*), bool*, float (*)[10], float (*)[10], float (*)[10]> >::__result<std::tuple<void (*)(bool*, float*, float*, float*), bool*, float (*)[10], float (*)[10], float (*)[10]> >’
  247 |  operator()()
      |  ^~~~~~~~
/usr/include/c++/9/thread: In instantiation of ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(float*); _Args = {float (*)[10]}; <template-parameter-1-3> = void]’:
main.cpp:17:43:   required from here
/usr/include/c++/9/thread:120:44: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
  120 |           typename decay<_Args>::type...>::value,
      |                                            ^~~~~
/usr/include/c++/9/thread: In instantiation of ‘struct std::thread::_Invoker<std::tuple<void (*)(float*), float (*)[10]> >’:
/usr/include/c++/9/thread:131:22:   required from ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(float*); _Args = {float (*)[10]}; <template-parameter-1-3> = void]’
main.cpp:17:43:   required from here
/usr/include/c++/9/thread:243:4: error: no type named ‘type’ in ‘struct std::thread::_Invoker<std::tuple<void (*)(float*), float (*)[10]> >::__result<std::tuple<void (*)(float*), float (*)[10]> >’
  243 |    _M_invoke(_Index_tuple<_Ind...>)
      |    ^~~~~~~~~
/usr/include/c++/9/thread:247:2: error: no type named ‘type’ in ‘struct std::thread::_Invoker<std::tuple<void (*)(float*), float (*)[10]> >::__result<std::tuple<void (*)(float*), float (*)[10]> >’
  247 |  operator()()
      |  ^~~~~~~~

I thought that I forgot some ctor arguments for the dma thread but that is not the case.
Here is my code:

#include <iostream>
#include <cstdint>
#include <thread>

void dma_service(bool*, float*, float*, float*);
void live_audio(float*);
void live_draw(float*);


    
    constexpr int d_size = 10;
    float data[d_size];
    float pwm_cp[d_size];
    float fft_cp[d_size];
    bool drdy = 0;
    std::thread dma_thrd(dma_service, &drdy, &data, &pwm_cp, &fft_cp);
    std::thread audio_thrd(live_draw, &pwm_cp);


int main(){
    for (auto i = 0; i < d_size; i++)
    {
        data[i] = 0;
        pwm_cp[i] = 0;
    }
    printf("Hello, World!n");
    drdy = 1;

    int k = 3;
    while(k-->0)
    {
        audio_thrd.join();
        printf("nnn");
        
        for (auto i = 0; i < d_size; i++)
        {
            data[i]++;
        }
        drdy = 1;
    }

}

void dma_service(bool* flag, float* d_array, float* pwm_array, float* fft_array) {
    while (!flag) ;

    for (auto i = 0; i < d_size; i++)
    {
        pwm_array[i] = d_array[i];
        fft_array[i] = d_array[i];
    }

    flag = 0;

}

void live_audio(float* pwm_array) {
    dma_thrd.join();
    printf("Audio Array:n");
    for (auto i = 0; i < d_size; i++)
    {
        printf("PWM_CP[%d] %fn", i, pwm_array[i]);
    }
}

I don’t have much experience with lambda functions so I have no idea if they’re needed here (and would be happy to avoid them).
Thanks for any suggestions!

В настоящее время я пытаюсь научиться использовать потоки, и у меня проблема с передачей аргументов функции, выполняемой в другом потоке.

void Class::foo(const string& a, size_t b, Obj& c);

(поток, выполняющий эту функцию, объявлен внутри класса Class)

В последнем случае я использую std :: ref (), как указано в документации, но все равно сталкиваюсь с той же ошибкой компиляции.

Когда я создаю тестовую функцию в анонимном пространстве имен с тем же прототипом, ошибка не появляется.

Есть ли проблема с выполнением метода класса в другом потоке? Как можно решить проблему?

Вот ошибка:

/usr/include/c++/8/thread:120:17: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
  static_assert( __is_invocable<typename decay<_Callable>::type,
                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
           typename decay<_Args>::type...>::value,

И параметры, которые я использую для создания потока:

(&Class::foo, cref(charSet), b, ref(c))

2 ответа

Лучший ответ

Если вы используете invoke для нестатического члена, вы должны передать экземпляр Class, иначе вы получите другую перегрузку, которая не идентифицирует первый аргумент как вызываемый.

 std::invoke(&Class::foo, instance_of_class, cref(charSet), b, ref(c) );

Такая же ситуация с std::thread, которая даже показана на примерах его использования:

 foo f;
 
 std::thread t5(&foo::bar, &f);


1

Swift — Friday Pie
19 Дек 2020 в 20:43

Я забыл передать объект Class в качестве аргумента … Большое вам спасибо !!

(&Class::foo, this, cref(charSet), b, ref(c))


1

evocorsa
19 Дек 2020 в 20:42

Не могу понять как мне создать поток.

Часть кода:

#include <thread>

std::shared_ptr<Admin::ServerManager> Admin::ServerManager::mServerManager = nullptr;
std::mutex Admin::ServerManager::mMutex{};

bool Admin::ServerManager::exec(commandType type)
{
    std::thread th(&ServerManager::start);
    switch (type)
    {
        case START:
            start();
            return true;

        case STOP:
            stop();
            return true;
//Some Code

void Admin::ServerManager::start()
{
    if(serverStatus == 0)
    {
        serverStatus = 1;
        Admin::ServerManager::Socket.reset(new Network::ServerSocket);
    }
    else
        std::cout << "The server is already up";
}

Ошибки, которые вылетают при билде:
1) /usr/include/c++/9/thread:120: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
In file included from /home/left/Desktop/Projects/SocketServer/src/Core/AdminComponent/src/ServerManager.cpp:2:
/usr/include/c++/9/thread: In instantiation of ‘std::thread::thread(_Callable&&, _Args&& …) [with _Callable = void (Admin::ServerManager::*)(); _Args = {}; = void]’:
/home/left/Desktop/Projects/SocketServer/src/Core/AdminComponent/src/ServerManager.cpp:9:41: required from here
/usr/include/c++/9/thread:120:44: error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues
120 | typename decay<_Args>::type…>::value,
| ^~~~~
2)/usr/include/c++/9/thread:243: error: no type named ‘type’ in ‘struct std::thread::_Invoker >::__result >’
/usr/include/c++/9/thread:131:22: required from ‘std::thread::thread(_Callable&&, _Args&& …) [with _Callable = void (Admin::ServerManager::*)(); _Args = {}; = void]’
/home/left/Desktop/Projects/SocketServer/src/Core/AdminComponent/src/ServerManager.cpp:9:41: required from here
/usr/include/c++/9/thread:243:4: error: no type named ‘type’ in ‘struct std::thread::_Invoker >::__result >’
243 | _M_invoke(_Index_tuple<_Ind…>)
| ^~~~~~~~~
3)/usr/include/c++/9/thread:247: error: no type named ‘type’ in ‘struct std::thread::_Invoker >::__result >’
/usr/include/c++/9/thread:247:2: error: no type named ‘type’ in ‘struct std::thread::_Invoker >::__result >’
247 | operator()()
| ^~~~~~~~

Answer by Antonio Foley

No, it expects any callable type, and a member function pointer such as &Foo::threadFunc can be invoked with an argument of type Foo or Foo& or Foo*. You can pass a reference if you want, but that’s not what your code does. If you want to pass a reference use std::thread(&Foo::threadFunc, std::ref(*this)); so it doesn’t try to make a copy.

– Jonathan Wakely

Aug 19 ’13 at 8:16

,What am I doing wrong? I don’t have such problem on Windows with VS2012. I also didn’t have this problem with default stdlib implementation on Mac, but now I have to use libc++.,

Stack Overflow for Teams
Where developers & technologists share private knowledge with coworkers

,N.B. your program will terminate because you do not join the thread. In your type’s destructor you should do something like:

    _th = std::thread(&Foo::threadFunc, *this);

You probably want to store a pointer to the object, not a copy of the object:

    _th = std::thread(&Foo::threadFunc, this);

N.B. your program will terminate because you do not join the thread. In your type’s destructor you should do something like:

~Foo() { if (_th.joinable()) _th.join(); }

Answer by Guillermo Goodwin

Here’s the relevant error:,Here’s the relevant code and the relevant error, I’m not really sure what to make of it.,Additionally, you might want to consider using std::function. It’s a much more modern and cleaner interface than using void pointers.,If you add any files,it will delete all existing files related to this question-(questions only answer remains unchanged)

Here’s the relevant code and the relevant error, I’m not really sure what to make of it.

Breaker::Thread::Thread(std::string name, std::string desc, void* func)
{
    std::thread _thread(func);

    _thread.join();
}

That’s in thread.cpp, the next is in log.cpp…

thread = new Breaker::Thread("System Log", loop);

and

void* Breaker::Log::loop()
{
    add("test");
}

Here’s the relevant error:

In file included from /home/nope/Documents/dev/C++/Breaker Engine/src/core/thread.cpp:25:
In file included from /home/nope/Documents/dev/C++/Breaker Engine/src/core/thread.h:28:
/usr/bin/../include/c++/v1/thread:332:5: error: attempt to use a deleted function
    __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...);
    ^
/usr/bin/../include/c++/v1/thread:342:5: note: in instantiation of function template specialization 'std::__1::__thread_execute<void *>' requested here
    __thread_execute(*__p, _Index());
    ^
/usr/bin/../include/c++/v1/thread:354:42: note: in instantiation of function template specialization 'std::__1::__thread_proxy<std::__1::tuple<void *> >'
      requested here
    int __ec = pthread_create(&__t_, 0, &__thread_proxy<_Gp>, __p.get());
                                         ^
/home/nope/Documents/dev/C++/Breaker Engine/src/core/thread.cpp:95:14: note: in instantiation of function template specialization
      'std::__1::thread::thread<void *&, void>' requested here
        std::thread _thread(func);
                    ^
/usr/bin/../include/c++/v1/type_traits:1027:5: note: '~__nat' has been explicitly marked deleted here
    ~__nat() = delete;
    ^

Answer by Rhys Cole

AsyncLoadSample function has (std::string& filePath) as parameter. And I think that this is a reason for my problem. I use threads a lot in my code and they work everywhere except this one case with std::string& as a parameter. I can’t avoid using string. What should I do?,another option is to leave the function as it is and pass a the string wrapped in a reference wrapper.,std::thread makes copies of the given arguments. then it passes them as performant as it can to the target function. this means that your lvalue-string argument filePath will get copied internally. then it gets casted to a rvalue-reference-string and passed to the target function. since your function takes a lvalue-reference but it gets passend an rvalue this does not compile.,Is there more to the error message? It should say which deleted function you’re trying to call.

the error message on gcc is:

error: static assertion failed: std::thread arguments must be invocable after conversion to rvalues

which is probably the same error as MSVC’s «attempt to use a deleted function». You can get around this by doing:

sampleLoadingThread = std::thread([this, &filePath]() { this->AsyncLoadSample(filePath); });

Answer by Vienna Greer

One of my classes won’t compile with this error : «attempt to use a deleted function».,I am writing a C++ library in Xcode 4.2,The error is telling you that your program attempts to use a deleted function. You’ll have to post the error you’re getting for more detailed help.,Also, there are rules in the C++ spec that lead to member functions being implicitly deleted.

In C++11 you can declare functions as deleted:

struct Foo {
    Foo(const Foo &) = delete;
};

Answer by Ramon Curtis

The correct is
m_tickThread = std::make_unique<std::thread>(std::bind(&TickManager::run, m_tickManager.get()));,My code was
m_tickThread = std::make_unique<std::thread>(std::bind(&TickManager::run, m_tickManager.get_deleter()));,I’ve used «get_deleter()» function. So, I solved this error of fixing this line.,»Attempt to use a deleted function thread»

The place of thread is

template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices> inline _LIBCPP_INLINE_VISIBILITY void __thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>) { __invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...); }

template <class _TSp, class _Fp, class ..._Args, size_t ..._Indices> inline _LIBCPP_INLINE_VISIBILITY void __thread_execute(tuple<_TSp, _Fp, _Args...>& __t, __tuple_indices<_Indices...>) { __invoke(_VSTD::move(_VSTD::get<1>(__t)), _VSTD::move(_VSTD::get<_Indices>(__t))...); }

Answer by Oakleigh Duffy

The thread is created in the MainContentComponent class, and generateProgression is a function of that class.,generateProgression is the function that generate’s MIDI based on var1 (integer) and var2 (boolean),The problem is that I’m getting a compile error saying : “Attempt to use a deleted function”.
Could anyone tell me what I’m doing wrong? ,Im making a MIDI generator in C++ using JUCE framework.
I’d like to do the generating in a different thread so it won’t block my entire program.
This is how I make my thread:

    std::thread generationThread (&MainContentComponent::generateProgression,var1, var2);

Answer by Sage Webb

Я пишу библиотеку C++ в Xcode 4.2
,
Я компилирую блок кода, который содержит std::thread::thread(ФП fp&&__, Аргументы &&…__args) функция, которая , как описано в документации c++ reference , выполняет следующие…
,
Семантическая проблема «Attempt to use a deleted function» met компиляция кода c++ с использованием std::thread
,
Что это значит в Xcode?

В C++11 вы можете объявить функции удаленными:

struct Foo {
    Foo(const Foo &) = delete;
};

Answer by Kasen Myers

C++11 addressed the need for a better solution through a new language feature:
deleted definitions [dcl.fct.def.delete]. (See “deleted definitions” in the
C++ standard draft.) Any function can be explicitly defined as
deleted:,Since C++11: Explicitly define the function as “deleted”.,Attempts to use a deleted function result in a compile time error with a clear
diagnostic, which is one of the key benefits over the pre-C++11 techniques.,Since deleted functions participate in overload resolution they can help catch
unintended uses. Let’s say we have the following overloaded print function:

The application of #2 and #3 to disable copying would look like this:

class MyType {
 private:
  MyType(const MyType&);  // Not defined anywhere.
  MyType& operator=(const MyType&);  // Not defined anywhere.
  // ...
};

The “mixin” approach (boost::noncopyable,
non-copyable mixin)

class MyType : private NoCopySemantics {
  ...
};

The macros approach

class MyType {
 private:
  DISALLOW_COPY_AND_ASSIGN(MyType);
};

C++11 addressed the need for a better solution through a new language feature:
deleted definitions [dcl.fct.def.delete]. (See “deleted definitions” in the
C++ standard draft.) Any function can be explicitly defined as
deleted:

void foo() = delete;

Attempts to use a deleted function result in a compile time error with a clear
diagnostic, which is one of the key benefits over the pre-C++11 techniques.

class MyType {
 public:
  // Disable default constructor.
  MyType() = delete;

  // Disable copy (and move) semantics.
  MyType(const MyType&) = delete;
  MyType& operator=(const MyType&) = delete;

  //...
};
class MyType {
 public:
  // Disable default constructor.
  MyType() = delete;

  // Disable copy (and move) semantics.
  MyType(const MyType&) = delete;
  MyType& operator=(const MyType&) = delete;

  //...
};
// error: call to deleted constructor of 'MyType'
// note: 'MyType' has been explicitly marked deleted here
//   MyType() = delete;
MyType x;

void foo(const MyType& val) {
  // error: call to deleted constructor of 'MyType'
  // note: 'MyType' has been explicitly marked deleted here
  //   MyType(const MyType&) = delete;
  MyType copy = val;
}

Note: by explicitly defining the copy operations as deleted we also suppress
the move operations (having user-declared copy operations inhibits the implicit
declaration of the move operations). If the intention is to define a move-only
type using the implicit move operations, =default can be used to “bring
them back”, for example:

MyType(MyType&&) = default;
MyType& operator=(MyType&&) = default;

Since deleted functions participate in overload resolution they can help catch
unintended uses. Let’s say we have the following overloaded print function:

void print(int value);
void print(absl::string_view str);

Calling print('x') will print the integer value of ‘x’, when the developer
likely intended print("x"). We can catch this:

void print(int value);
void print(const char* str);
// Use string literals ":" instead of character literals ':'.
void print(char) = delete;

Note that =delete doesn’t affect just function calls. Attempting to take the
address of a deleted function will also result in a compilation error:

void (*pfn1)(int) = &print;  // ok
void (*pfn2)(char) = &print; // error: attempt to use a deleted function

Defining destructors as deleted is stricter than making them private (although
this is a big hammer and it may introduce more limitations than intended)

// A _very_ limited type:
//   1. Dynamic storage only.
//   2. Lives forever (can't be destructed).
//   3. Can't be a member or base class.
class ImmortalHeap {
 public:
  ~ImmortalHeap() = delete;
  //...
};

Yet another example, this time we want to only allow the allocation of non-array
objects ([real world example][crashpad]):

// Don't allow new T[].
class NoHeapArraysPlease {
 public:
  void* operator new[](std::size_t) = delete;
  void operator delete[](void*) = delete;
};

auto p = new NoHeapArraysPlease;  // OK

// error: call to deleted function 'operator new[]'
// note: candidate function has been explicitly deleted
//   void* operator new[](std::size_t) = delete;
auto pa = new NoHeapArraysPlease[10];

Answer by Paislee Moody

John’s ‘blog’
,(thanks to http://stackoverflow.com/questions/8299545/passing-arguments-to-thread-function),

Follow

Following

John’s ‘blog’

Sign me up

Already have a WordPress.com account? Log in now.

,

John’s ‘blog’

Customize

Follow

Following

Sign up
Log in
Copy shortlink
Report this content

View post in Reader

Manage subscriptions

Collapse this bar

I was trying to compile some C++ of the form

std::vector<std::thread> threads;
for (int i = 0; i<num_threads; ++i)
{
   threads.push_back(std::thread(logisticTest, kmer_lines[i], samples);
}

with function prototype

void logisticTest(Kmer& k, const std::vector<Sample>& samples);

Second error message: attempt to use a deleted function __invoke(_VSTD::move(_VSTD::get<0>(__t)), _VSTD::mov…
Solution: pass to thread by value rather than reference. e.g.

std::reference_wrapper: threads.push_back(std::thread(logisticTest, std::ref(kmer_lines[i]), std::cref(samples)));

Понравилась статья? Поделить с друзьями:
  • Error statement has no effect
  • Error stray 363 in program
  • Error statement cannot resolve address of overloaded function
  • Error stray 361 in program
  • Error state фильтр калмана