python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Assigning values to std::array of std::optional objects
I am trying to fill a std::array of std::optional objects as below.
class MyClass
{
private:
int distance;
MyClass(int x, int y);
friend class MasterClass;
};
MyClass::MyClass(int x, i...
TeenyTinySparkles
Votes: 0
Answers: 1
How to construct an array using make_unique
How can I use std::make_unique to construct a std::array?
In the following code uptr2's declaration does not compile:
#include <iostream>
#include <array>
#include <memory>
int mai...
digito_evo
Votes: 0
Answers: 1
How to find the index of a specific element in a std::array<std::optional<unsigned int>, N>?
I have an array of size 80, std::array< std::optinal<unsigned int>, 80> myArray which contains numbers from 0-9.
I would like to get the index of the first array element with value x=5.
Wh...
TeenyTinySparkles
Votes: 0
Answers: 2
What is the best way to copy a std::array passed as a parameter?
I've been working on a game written with C++ and SDL2 in my free time and I'm refining some of my base classes for drawable objects. These objects have a position (x and y) and a size (width and heigh...

Henry Dikeman
Votes: 0
Answers: 2