• Forum
  • General C++ Programming

General C++ Programming

by admin
Welcome to this board!
 
Welcome to the general programming forum in C++.com! In this forum, users can to talk about any top...
[no replies]
Euler Angle Compression
 
I realize this is probably more of a math question than C++ question but I figured I might as well t...
[no replies]
Cylic inclusion and forward declaration and template issue.
 
Hi, I've two classes (Server and Network) which have a template function defined in the .h file beca...
[3 replies] Last: For others interested, here was my original example now split into mul... (by Ganado)
How to init this static var
 
Hi! I've a template class Application which have a static var. (a pointer to the application instanc...
[2 replies] Last: Templates need to be defined in the header file (unless you add explic... (by Peter87)
discussion on std::ranges::iterator_t<T> being distinct from T::iterator (and same for begin)
 
I recently spent an hour or so on a bug that came down to std::ranges::const_iterator_t<T> sometimes...
[4 replies] Last: [quote=Xaxazak]I recently spent an hour or so on a bug that came down ... (by TheIdeasMan)
by Ganado
Safer way to maintain struct initializations
 
I ran into this problem a bit ago, and was wondering what future-proofing refactor people would sugg...
[5 replies] Last: Maybe you want to take a look at the "pimpl" (pointer to implementati... (by kigar64551)
PNG File Reader (1,2)
 
I have been on a quest to write some kind of PNG file reader, mostly just for myself, and I was wond...
[38 replies] Last: Hmm... learning something new. According to cppreference.com it is on... (by Duthomhas)
by kitfox
How to create white noise random hashing function?
 
I'm trying to figure out how to build a random hashing function that emphasizes speed and repeatabil...
[1 reply] : I think you can use any proper hash function to produce a (pseudo) "... (by kigar64551)
Use C++ 20 with Embarcadero
 
I have been using C++ builder for some C projects. It works really well. However, I have been trying...
[4 replies] Last: The last recourse is the "other compiler options" where you can just l... (by salem c)
Call of Templated Function w/ Explicit Template Argument Fails to Compile
 
greetings kind regards may i please enquire why compiler reports error for code below as indicated ...
[1 reply] : The meaning of the name _T.aaa depends on the template parameter T ... (by mbozzi)
scientific computing - optimize speed
 
Greetings, this is a longer thread, so thank you in advance for anyone who takes the time. It might...
[16 replies] Last: Just leaving this here. https://en.wikipedia.org/wiki/Barnes%E2%80%93... (by salem c)
why can't I use cout with without iostream
 
Basically what the tittle says I wanted to output something so I only included the ostream libr...
[5 replies] Last: And then there is <iosfwd> (by keskiverto)
Pybind11 slows my C++ code substantially
 
Greetings everyone, continuing with my particle simulation, I am trying to turn it into a python pa...
[4 replies] Last: of course it can. you may need to hand wave at byte ordering if you g... (by jonnin)
anagram using vector
 
I am trying to solve this problem. Are there any other better approaches here? Implement a functio...
[2 replies] Last: If you go big (a large dictionary of words) you may want to move out t... (by jonnin)
Making a shared_ptr out of a stack object corrupts the heap!!
 
Hi, The following code is incorrect: Customer customer = { 0, "John Doe", "johndoe@exam...
[2 replies] Last: Note: std::make_shared<T>() creates a new heap-allocated instance of... (by kigar64551)
Testing restart functionality in C/C++
 
Hello! I am trying to implement "restart" functionality in my code, where if for some reason the co...
[1 reply] : you will get more help if you put it in a repo where we can see the co... (by jonnin)
Need a data structure where I can map a string to a type
 
Hi, Need a certain compile time map m like this: using Type = typename m["Customer"]::type;...
[10 replies] Last: It's not necessary to use an enum. It was just a suggestion. (by Peter87)
Save to file with vector (dynamically)
 
I have created a programme that does calculations and generates results from those calculations. ...
[11 replies] Last: i outside the loop is not a c++ error. It is a questionable programmi... (by jonnin)
what does T = 0 mean in a template parameter?
 
What does T = 0 mean in the following code: template<typename T, T = 0> T moduloOf(T a, T b...
[4 replies] Last: Indeed: "initialized with value 0" limit what type the T can be? (by JUANDENT)
When does early binding happen?
 
Thing 1: Static binding takes place during compilation - function calls are replaced with an inst...
[1 reply] : I guess this is what's called "devirtualization" which GCC has optimiz... (by Peter87)
  Archived months: [apr2025]