• 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 topic related to programming in the C++ language that does not ...
Jan 14, 2008 at 1:17pm
[no replies]
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 repeatability. Basically, for input it will have an unsigned int seed...
Apr 28, 2025 at 8:21am
[1 reply] : I think you can use any proper hash function to produce a (pseudo) "... (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 wondering if there is any good resources on how to do binary fil...
Apr 28, 2025 at 6:19am
[29 replies] Last: Hey, welcome back! 1. How does your code handle cases where the rati... (by Duthomhas)
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 being different from T::const_iterator. For example: === s...
Apr 26, 2025 at 12:36am
[no replies]
Use C++ 20 with Embarcadero
I have been using C++ builder for some C projects. It works really well. However, I have been trying to run some code from a tutorial I want to follow and I get...
Mar 18, 2025 at 3:36am
[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 . thank you kindly template<typename T, typename U> voi...
Mar 15, 2025 at 10:20pm
[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 be that no one can help me without sharing the whole github...
Mar 7, 2025 at 8:53am
[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 library but when I tried to output something with cout i saw ...
Mar 6, 2025 at 3:48pm
[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 package (I work in maths, and most people would never be able ...
Feb 6, 2025 at 11:02am
[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 function which takes a list of words as an argument and finds all a...
Dec 5, 2024 at 1:32pm
[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@example.com" }; auto cc = std::make_shared<Customer>(customer);...
Nov 20, 2024 at 1:05pm
[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 code stops (i.e. iterations drop) I can pick up from where I s...
Nov 16, 2024 at 9:28pm
[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; // Type would be Customer How can i do this? Regar...
Nov 12, 2024 at 9:03am
[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. The imformation generated is stored in variables for later d...
Nov 9, 2024 at 6:28pm
[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) { return a % b; }
Oct 31, 2024 at 11:08am
[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 instruction saying "go here for the appropriate function definit...
Oct 18, 2024 at 7:21am
[1 reply] : I guess this is what's called "devirtualization" which GCC has optimiz... (by Peter87)
Would like some testers please
Sorry is this is the wrong forum. If possible I would like someone to try out my program. It works for me but I want to know if it works for other people. ...
Oct 17, 2024 at 4:29pm
[10 replies] Last: There's a special GitHub repo set up to make it easy to learn how to f... (by deleted account xyzzy)
_Safe_add checks for overflow but does not do anything to report the problem!
Looking at VC++ source files I find in ratio the following: what is the purpose of _Safe_add_integer_arithmetic_overflow_error? inline void _Safe...
Oct 9, 2024 at 2:04pm
[5 replies] Last: Neat example, thanks. (by Ganado)
templates class friends strong types
Hello all, first a bit of background. Land Surveying involves many types of: Angles, Bearings; Distances; Co-ordinates; and there are many types adjustments ...
Oct 3, 2024 at 10:02pm
[8 replies] Last: I read Jonathon Boccara's blog That article is from 2016, C++20's co... (by deleted account xyzzy)
unresolved external symbol "int const value"
One file states: extern const int value; extern const int this_cpp; const int mine = value; const int yours = 40; and another cpp states co...
Sep 22, 2024 at 4:52pm
[1 reply] : Your other.cpp file also needs to say extern, otherwise it's taken to ... (by salem c)
  Archived months: [feb2025]

Registered users can post in this forum.