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

I am refactoring a project, and I have to unify a set of derived classes under the same base class. These are two derived classes: class D1 : public virtual B { virtual int F(int i) { ...
Pietro's user avatar
  • 13.6k
3 votes
1 answer
226 views

#include <chrono> #include <string> using namespace std::literals; int main() { ""s.size(); // ok (""s).size(); // ok (5ms).count(); // ok 5ms....
0 votes
2 answers
143 views

Consider the following code: int main() { auto const fn = [] mutable {}; fn(); // ok, why? } As per the latest C++ standard draft [expr.prim.lambda.closure] 7.5.6.2/6 (emphasis mine): The ...
16 votes
3 answers
1k views

Using g++ -std=gnu++17 -Werror -Wall -Wextra the following code compiles without warning: struct Mutable { int x; }; class State { public: constexpr const Mutable &Immutable() const { ...
5 votes
2 answers
116 views

I have a class that looks like this template<class T, class THash, class TEqual, class TCompare> class GraphT { public: typedef NodeT<T, THash, TEqual, TCompare> NodeInt; typedef ...
1 vote
1 answer
149 views

could you please help me how to handle (initialize, call) std::array of structs of std::function. Code like below: class A { struct Functions { std::function<bool()> handler1; std::...
3 votes
1 answer
229 views

In modern C++ is it possible to write a member function alias with a syntax different from this: class C { int f(int a) { return ++a; } inline int g(int a) { return f(a); } }; I tried in a few ...
Pietro's user avatar
  • 13.6k
3 votes
1 answer
85 views

I'm trying to create sort of an event system, I don't care if it is suboptimal, I'm doing it for fun. I do not want alternate solutions, I want to understand why this isn't working and how could I fix ...
2 votes
2 answers
71 views

Why don't I see implicitly generated constructors/destructor/ etc in the symbol table for my C++ code? E.g #include <iostream> class Foo { public: Foo (int N) : values {new int[N]}{ ...
TCD's user avatar
  • 183
0 votes
1 answer
78 views

The story continues ... my earlier two questions were about the member functions fReadData and fReadData2 Public Function fReadData(alue As Range) As Double pOne = alue.Cells(1) fReadData = ...
0 votes
1 answer
56 views

I send earlier question concerning class member function. Now I am facing a new problem, if the member function return value is a class where the function is defined. The member function fReadData ...
0 votes
1 answer
57 views

I am trying to make Excel VBA class member function fReadData which returns some values from the Excel spreadsheet and uses the class definition ClassOne, only for testing purposes. ' ClassOne Option ...
1 vote
1 answer
128 views

Is it possible to replace following ref-qualifiers with concepts? That is, instead of struct S { void func() && {} void func() & {} }; have something like this struct S { void ...
2 votes
4 answers
168 views

Hi there I am facing the following problem: I have a class with many member functions of a certain pattern. Each of these member functions has 3 overloads and these overloads are the same for all ...
4 votes
1 answer
245 views

I wrote the following program that compiles with msvc but rejected by clang and gcc. It uses explicit object member function. Demo. #include <iostream> struct C{ int f(this int); }; ...
user avatar

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

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