General C++ Programming - September 2023

Use concepts to test for member functions
 
Hey guys, I'd like to use concepts to verify that an interface is implented correctly. Usally I wo...
[4 replies] Last: AH thx alot, now it's working fine :) (by JuliusCaesar)
Wait for stdout completed (C)
 
For C. Is there a way to wait for all output sent to stdout to be displayed before continuing? I hav...
[9 replies] Last: We don't 'mix' our io with standard output. We only use standard outpu... (by seeplus)
by PeteDD
Use array as incrementer in for loop - no longer compiling
 
I am in the process of moving some code to a new toolchain and encountered the following code (which...
[8 replies] Last: I'm still left wondering why the developer put this variable in as an... (by coder777)
by ruzip
GLUT Keys with VK Keys
 
I'm looking for a way to make the GLUT key functions to work simultaneously with VK Keys (GetAsync...
[2 replies] Last: Thanks kilgar, but actually not involving any external library. And a... (by ruzip)
How to implement FFTW efficiently in C/C++?
 
From the FFTW documentation: You are probably recreating the plan before every transform, rather...
[13 replies] Last: I'm surprised there's even a correlation between thread count and elap... (by helios)
by jNc
send text to clipboard
 
Having some text that I want to send to clipboard, something like string "random text", I want to c...
[4 replies] Last: It looks like the modern default Ubuntu does not come with a clipboard... (by newbieg)
time elapsed since local midnight?
 
I need to find the elapsed time (duration) from local midnight. I tried this: // if we have a t...
[6 replies] Last: You could also write this without zoned_time if you prefer: int ma... (by mbozzi)
How to get sys_days from local_time?
 
In attempting to create a today() function, then first idea that comes to mind is this: sys_da...
[6 replies] Last: Note that for Windows, C++ time zone data is only available from Windo... (by seeplus)
What is a strict weak ordering?
 
a total ordering means for all a,b in Container, one of the following is true: a < b a == b a >...
[9 replies] Last: Thanks Helios!! (by JUANDENT)
by Cplusc
Point In Triangle
 
I am trying to generate points with equal spacing inside complex geometry. I have the STL file repre...
[5 replies] Last: A'ight. (by helios)
How to implement MATLAB's colon operator in C++?
 
I have the following MATLAB code that uses zero padding to deal with aliasing errors that I would li...
[2 replies] Last: If you want zero padded output look to either C's printf or C++20's ... (by George PlusPlus)
istream_iterator invokes reading from the keyboard by just defining it!!
 
Hi, The following code opens for reading from the keyboard instead of waiting for the vector: (th...
[7 replies] Last: Pressing enter does not end the stream. Correct. This iterates the... (by seeplus)
How can ofstream not trunc existing file?
 
Hi, I have this code that erases the output file as it opens it... I want to not truncate the fil...
[2 replies] Last: I think the "problem" with the above code is that is not atomic. Fo... (by kigar64551)
how to insert into an unordered_map for a given struct
 
Hi, I have this code which gives me an illegal indirection: unordered_map<Record, Record, R...
[3 replies] Last: Thanks!! (by JUANDENT)
  Archived months: [aug2023] [oct2023]

This is an archived page. To post a new message, go to the current page.