python (65.1k questions)
javascript (44.2k questions)
reactjs (22.7k questions)
java (20.8k questions)
c# (17.4k questions)
html (16.3k questions)
r (13.7k questions)
android (12.9k questions)
How to solve "error C2078: too many initializers" when moving the same members from the parent class to its child?
I am facing a relatively tricky situation here that seemed quite easy at first sight. After moving those three members from the parent class Parent to its child class Child it seems that I'm no longer...
tbop
Votes: 0
Answers: 1
Initialize POD with two arrays using a factory function in C++11
I need to POD-initialize a struct of multiple arrays from a factory function. How do I forward its parameters to the brace-init list that is required to create the POD-struct (C++11)? I get this error...
glades
Votes: 0
Answers: 1
C++: insert element into std::map<MyStruct> where MyStruct can only be aggregate initialized and contains const unique pointers
Here is what I am trying to do and what I have tried:
#include <memory>
#include <map>
#include <string>
using namespace std;
struct MyStruct {
const unique_ptr<int> a;
...
Mircode
Votes: 0
Answers: 2
Aggregate instantiating structs
Are there benefits to instantiating structs using aggregate initialization as opposed to having an init function to return an instance? This is what I'm talking about:
sturct Data
{
float x, y;
...
Neosapien
Votes: 0
Answers: 1