• 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 ...
[no replies]
by kitfox
Will my compiler automatically reuse the return value of this method?
 
I'm wondering if my compiler will be smart enough to realize that the determinant() of this matrix has already been calculated and will reuse the value that was...
[2 replies] Last: I agree the answer is no, the compiler is not smart enough in general,... (by Ganado)
Proposal for explict keyword for non constructor functions
 
So we have the explicit specifier for constructors, would it be better if we could have explicit for any type of callable functions as well. At the moment w...
[4 replies] Last: Cheers seeplus Also kind of related to this is the idea of list ini... (by TheIdeasMan)
by Ganado
Why must base class be constructed before derived members?
 
I ran into this problem when trying to encapsulate behavior into an existing, rigid structure of a project I'm working on. See both the DerivedBad and Derive...
[5 replies] Last: MS VS doesn't produce a warning - which would be useful as I've been d... (by seeplus)
by kitfox
What's the proper way to set a std::vector to another std::vector?
 
I'm trying to figure out the optimal way to do this assignment. Right now I'm just doing a simple assignment, but was wondering if using std::swap() would be b...
[5 replies] Last: The outermost loop is what bothers me most. Assuming that there is at ... (by newbieg)
Implementation of headers
 
I've recently been learning about command-line commands and how all that stuff works and I have gotten curious, for various of the standard headers in C++ (such...
[3 replies] Last: I see! thank you for the sources and stuff, I will have to check them ... (by Heyyo53)
Pure virtual calls not resolving
 
Using VS 2022 Version 17.14.25 Having trouble getting pure virtual calls to link. I have a solution with a main project and several DLLs. The main class inher...
[2 replies] Last: Got it. Thanks. (by AbstractionAnon)
by kitfox
Why can I not link?
 
I'm putting together a small project to generate tetrahedralizations of 3D meshes: https://github.com/blackears/cyclops_tetrahedralizer This is the first time ...
[2 replies] Last: Your issue looks like it comes down to object lifetime and how memory ... (by LisaBedard)
by kitfox
Can I make this a constexpr?
 
I have small array that I'm using to store some directional data. I'm trying to adapt this to be a member of a class: class BVHTree { static const...
[2 replies] Last: On GCC, it doesn't compile with -std=c++17 , but will compile with -... (by Ganado)
by kitfox
How to let user specify float size in data structure?
 
I'm writing a library to do a math calculation. For my purposes I want to use 32 bit floats, but I can imagine other users wanting to use other sized types. I...
[1 reply] : https://stackoverflow.com/a/70773753 (by kigar64551)
Declaring an initializer class list with classes that are circular dependent
 
I've really tried to make this work without using pointers. I want to create a shared class where two classes "see" each other and share this object. I want...
[4 replies] Last: Yes, if a class contains a reference to something else as a data membe... (by Ganado)
sorting an integer array
 
hello everyone, im new here trying to learn c++, i wrote a code to sort array but the out put always be like this [10, 1, 2, 3, 4, 5, 6, 7, 8, 9] i can't move 1...
[14 replies] Last: I use VS 2022 (not code). If you're getting an error with std::size t... (by seeplus)
convert a std::string to const char*
 
i use this code working good const char* SPattern{ "\x55\x00\x00\x00\x00\x00\x00\x00\x57" }; const char* SMask{ "x???????x"}; char* geta...
[6 replies] Last: I'm not working off complete information since I don't know what memor... (by Ganado)
Increasing Size of Vector (1,2)
 
HI, I need to increase the size of my vector. However the program crashes. How do I increase the size and prevent it from crashing. Below is the vector in ques...
[29 replies] Last: 2) "make them static or move their definition to be before main()." ... (by seeplus)
by hmoein
A light and agile thread pool for the masses
 
https://github.com/hosseinmoein/Leopard
[no replies]
by hmoein
C++ DataFrame library
 
I wanted to introduce the C++ DataFrame -- https://github.com/hosseinmoein/DataFrame -- library in this forum for the first time. C++ DataFrame is a library for...
[3 replies] Last: I think all of it could fit; https://www.boost.org/doc/libs/1_75_0/doc... (by firedraco)
Euler Angle Compression
 
I realize this is probably more of a math question than C++ question but I figured I might as well try asking here too since it is in the context of a C++ tool,...
[2 replies] Last: It looks to me like the rotations are simply discarding a coordinate f... (by Duthomhas)
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 because we must define template function to header files. The p...
[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 instance) I declare it like this : static Application<A, T>* app...
[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 being different from T::const_iterator. For example: === s...
[4 replies] Last: [quote=Xaxazak]I recently spent an hour or so on a bug that came down ... (by TheIdeasMan)
  Archived months: [jan2026]