Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
5 votes
1 answer
184 views

I'm writing an async, callback-heavy program, and a common pattern I encounter is, in a member function, having to make a callback pointing to another member function. What I have so far is this: void ...
1 vote
1 answer
51 views

Here is my simplified code: S.h class SBase { ... public: virtual std::vector<int32_t> getNumbersSet1(); virtual std::vector<int32_t> getNumbersSet2(); } class SDerived : public ...
1 vote
0 answers
73 views

Objective I'm attempting to wrap a variadic function so I can provide an arbitrary set of arguments now and provide the rest later. Ultimately, I want to be able to do something like this: template<...
0 votes
3 answers
274 views

I want to handover a class member as a callback function in C-style to an external DLL. What I got so far: void MyCallback(double a, unsigned char b, unsigned char* c) { // do something } The DLL ...
3 votes
1 answer
92 views

In the following code, there are generic classes reg and regmap and a user-defined class mymap which is derived from the regmap class. In the mymap class, the user creates instances of reg and ...
KPathak's user avatar
  • 59
0 votes
0 answers
108 views

C++ compilers warn if pure virtual functions are directly called in a constructor/destructor (but not indirectly). Binding a pure virtual function and storing the result in a class member and calling ...
0 votes
0 answers
65 views

I thought I had a hold on std::bind, but the compiler has me stumped on this one. Currently compiling with c++17. I have a generic way of binding a function to a bunch of arguments so that it can be ...
2 votes
0 answers
164 views

What if I have a range of pairs and I want to generate a new range from the reduction of those pairs? So my overly "std::" loving brain thought of this: auto vec_of_pairs = std::vector { ...
-1 votes
1 answer
82 views

As shown in the code and output below, three phenomena can be observed: For mem_fn, which is f1 in the code, whether it is passed ff or &ff, the num_ value in the ff object can be modified ...
0 votes
2 answers
278 views

I'm playing with functional programming in C++20 and write something like that: template <class OuterFn, class InnerFn, class... Args> concept Composable = std::invocable<OuterFn, std::...
4 votes
2 answers
158 views

I need a way to decompose the function object returned by std::bind() to its arguments in a function template. The code snippet below shows what I'd like to do: #include <iostream> #include <...
7 votes
3 answers
185 views

This is my code snippet: class Base { public: Base() { foo(); bind(); } virtual void foo() { std::cout << "base foo\n"; } void bind() { fn = std::bind(&...
1 vote
1 answer
323 views

I noticed that the std::bind_front/std::bind_back/std::not_fn that yields the perfect forwarding call wrapper all require that the function argument and argument arguments passed in must be move-...
1 vote
1 answer
110 views

The goal is to get a functor to the Base::Print. #include <functional> #include <iostream> using namespace std; class Base { public: virtual void Print() { cout << "...
1 vote
2 answers
282 views

Suppose we have the following hierarchy: class Add3Interface { virtual int add3 (const int&) const = 0; }; class Add3: public Add3Interface { virtual int add3 (const int& arg) const ...
antonio's user avatar
  • 483

15 30 50 per page
1
2 3 4 5
...
26

AltStyle によって変換されたページ (->オリジナル) /