118 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
137
views
I can't get an optional with (cond) ? value : nullopt ... what should I write instead?
Suppose I'm implementing the function returning an std::optional<T>. In that function, I compute some condition, and then want to return either a value, or a nullopt. I can do it like so:
std::...
0
votes
0
answers
55
views
Why the destructor pointer is null in construction vtable?
My code is below:
class GrandParent {
public:
GrandParent() {}
virtual ~GrandParent() {}
int grandparent_data = 100;
};
class Parent1 : virtual public GrandParent {
public:
Parent1() {}...
0
votes
0
answers
26
views
Create and Edit the road typical section by Subassembly composser
Update the road assembly by sub assembly composser
Hello Everyone,
I need to create assembly of main road by sub-assembly composser, the road is two lane with median and jersey barries at the middle ...
1
vote
2
answers
77
views
Construct a variadic std::tuple using a parameter pack of constructor arguments
I have the following class definitions. I would like to create an Alphabet of Letter classes where each Letter class is constructed using an argument from the parameter pack passed to the Alphabet ...
0
votes
1
answer
141
views
How Can I Represent An Assembly Program With Labels?
I am trying to represent assembly programs in Coq and compile them into a sequence of bytes.
I have an assembly language, a decoder, a compiler, and proof that the decoder is the inverse of the ...
2
votes
2
answers
70
views
Is there a meaningful difference in this '@()' construction or is this a bug?
I have a function whose name parameter I want to provide tab completion for, the tab completion values are file names found in c:\temp. On top of using the files in c:\temp as values, I also want to ...
-1
votes
1
answer
123
views
CodeForces Contest > 1761 \ Problem C (Set Construction) - How to solve this problem?
Guys I have been working on this problem since morning (4 hours ago) and still couldn't find a proper answer. How can I set the Subsets with these conditions? So for example an A Set is a subset of A2 ...
0
votes
1
answer
44
views
https://github.com/autodesk-platform-services/aps-industrial-construction-explored. mongoDB GOT connected successfully. NOTHING PROGRESSES FROM THEN
We are keen to have 3D model overlay on Google map and handle the click event so show the graphs viz temperature and pressure realtime data.
Also, the issues reported by the system to be notified to ...
0
votes
1
answer
87
views
C++ - Interaction between move construction and forwarding
If I'm constructing a non-trivial container like a custom map for example,
and want to share code between the emplace and insert functions, one approach would be to have the insert function simply ...
0
votes
0
answers
99
views
Dart initialization and final, final late
Hi developers!I'm using Dart for flutter. I'm trying to figure out why the code below doesn't need 'late' or 'final' for its variables. I know what these terms mean, but I'm puzzled about when and ...
2
votes
1
answer
106
views
Haskell fast construction of vector from input of space separated ints
If I expect a string with space separated ints from user input (number of expected int's known), I can transfer it in haskell Data.Vector like this:
main = do
n <- readLn -- this is number ...
3
votes
2
answers
933
views
Construction vs Initialisation Formal difference
I am learning C++ using the books listed here. Now I came across the following statement from C++ Primer:
When we allocate a block of memory, we often plan to construct objects in that
memory as ...
user avatar
user19414420
1
vote
3
answers
349
views
How do I initialize all elements of TrieNodes' children to null
I am trying to solve a Trie problem, for which I create a TrieNode class as below:
class TrieNode {
public:
bool isWord;
TrieNode* children[26];
TrieNode() {
isWord=false;
...
8
votes
2
answers
303
views
Can a C++ constructor know whether it's constructing a const object?
In C++, object constructors cannot be const-qualified.
But - can the constructor of an object of class A know whether it's constructing a const A or a non-const A?
Motivated by a fine point in the ...
9
votes
1
answer
2k
views
How to in-place-construct an optional aggregate?
How to in-place construct an optional aggregate? It seems I can only construct an optional single thing, and not an optional aggregate of things.
#include <optional>
#include <iostream>
...