Skip to main content
-4 votes
0 answers
123 views

Hello all @ stack overflow i have a question vector<SSDS> abc(10); abc[0].insert_in(1,"Sandisk","1","2","3"); abc[1].insert_in(2,"Western&...
Acherontas's user avatar
2 votes
1 answer
186 views

I have 2 maps using BidBook = std::map<float, int, std::greater<>>; // price -> qty using AskBook = std::map<float, int, std::less<>>; I have a struct that contain iterator ...
Huy Le's user avatar
  • 1,989
16 votes
2 answers
718 views

I have a program that reads the coordinates of some points from a text file using std::istringstream, and then it verifies the correctness of parsing by calling stream's operator bool(). In general it ...
Fedor's user avatar
  • 24.7k
1 vote
1 answer
140 views

In the code below I'm defining a map and a multimap. Then I'm defining four iterators assigning them values from these containers: std::map<int, double> m; std::multimap<int, double> mm; ...
Dmitry Kuzminov's user avatar
0 votes
0 answers
65 views

I'm trying to run: BEGIN TRANSACTION; CREATE TABLE IF NOT EXIST abc(); SELECT( IF( ( SELECT 1 FROM information_schema.statistics WHERE index_name = 'abc_x' AND table_name = 'abc' ) > 0, SELECT 0, ...
Igor's user avatar
  • 6,473
15 votes
4 answers
1k views

Unlike C array, std::array is allowed to have zero length. But the current implementations differ in how std::array<T,0> is implemented, in particular the sizes of the object are different. This ...
Fedor's user avatar
  • 24.7k
3 votes
1 answer
321 views

As an exercice and side project I have started to write a runtime SIMD library in C++ that wraps around the intrinsics and that builds an expression tree. Each possible node in a tree must contain an ...
Johan Daniel's user avatar
0 votes
1 answer
104 views

Goal Use concise makefile with organized directory structure. In particular, I don't want to have to edit the makefile to manage dependencies with every new source addition. The assumed directory ...
Kungfunk's user avatar
  • 115
6 votes
2 answers
209 views

I need some help for understanding general basics of shared resource access in C++ multithreading. When I need some variable that must be accessible for several threads, I declare it as atomic, or ...
Alexander Leonov's user avatar
8 votes
2 answers
332 views

I'm creating a dll + supporting header for a C library; which then has a C++ implementation. The header file exposes an enum, returned by some of the functions. Is this example guaranteed to produce ...
UKMonkey's user avatar
  • 7,165
8 votes
2 answers
346 views

The following code prints "move constructor" with c++11/c++14 with -fno-elide-constructors. However, with c++17/c++20 and -fno-elide-constructors, no "move constructor" prints. Why ...
newID's user avatar
  • 343
1 vote
1 answer
128 views

I have two threads where one thread needs to wait for the other thread to complete its task. To solve this problem I decided to use std::condition_variable. My question is, should the thread that is ...
Joe J's user avatar
  • 1,349
1 vote
1 answer
169 views

This code is rejected by all compilers I could test it on, so I suppose it is ill-formed according to the standard. struct X { void f(); }; void (X::*fptr)() & = &X::f; // ERROR Here we ...
siga's user avatar
  • 499
2 votes
2 answers
125 views

I have a template struct with a nested class, eg. template <typename T> struct example { struct type { }; }; template <typename T> using example_t = typename example<T>::type; ...
Rumburak's user avatar
  • 3,753
-1 votes
2 answers
127 views

I want to cast an array of bits into a byte, it works by using a loop and bitshift, but I think it would be cost inefective if run repeatedly (I might be wrong). So I wanted to use a pointer with ...
A'S's user avatar
  • 41

15 30 50 per page
1
2 3 4 5
3784