• 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 Cplusc
Inconsistent Results with Different Methods
I’m facing an issue in a C++ project where two different methods for computing the same values are giving inconsistent results, despite both using the same in...
[16 replies] Last: Hi Cplusc, I hope all is well at your end :+) Sorry for an even late... (by TheIdeasMan)
Hello everybody, long time no post. My posts have been sporadic at best lately, but hopefully, this one will gain some traction and be helpful to many who find ...
[18 replies] Last: Not that it really matters your link lists different authors for the ... (by seeplus)
by stav
which one of these bytecode instruction designs is better?
I've been going down a bit of a rabbit hole trying to figure out the most optimal way to design a bytecode instruction class. To be clear an instruction is som...
[6 replies] Last: Its very good to know, as tables are very fast and you can often use t... (by jonnin)
Why are there multiple multithreading frameworks?
In my learning, I've come across several multi-threading frameworks. I know the language didn't officially provide thread support until C++11 and that some thre...
[8 replies] Last: PS. There's also: Intel Threading Building Blocks https://www.intel.co... (by seeplus)
by helios
About full-duplex sockets
Sockets are supposed to be full-duplex, right? So the endpoints should be able to send and receive literally at the same time. But how do you handle that at the...
[1 reply] : I'm not even sure what API you are using here 🤔 But, if we are tal... (by kigar64551)
Mismatch overload problem
Why does s have the value false? template<typename T> char test_have_range(decltype(&T::begin), decltype(&T::end)); template<typename T> short test_hav...
[1 reply] : #ifndef DUTHOMHAS_IS_ITERABLE_HPP #define DUTHOMHAS_IS_ITERABLE_HPP ... (by Duthomhas)
How to test if a type T has a begin<T> defined
I have a SFINAE context where I have the following: struct have_sort { char c; }; struct have_range { char c ; }; struct have_none { char c ; }; ...
[no replies]
why testing for member pointer determines the template type is a class?
why does this code determine if the type is a class: template<typename T> class is_class { template<typename C> static char test(int C::*); template<typena...
[4 replies] Last: Thanks!! (by JUANDENT)
Trouble with seeing where variable is initialized?
Hello, This question is in regards to the initialization of the variable value_type value; I can see that the struct foo is typed as the wrapper<int> b...
[4 replies] Last: [quote=lostwithcpp]this is only for structs, not classes? Technically... (by Peter87)
by Cplusc
C1090 error (1,2)
I am getting the following annoying and frustrating error which appeared suddenly out of nowhere. the code was working just fine and I don't know what happened....
[23 replies] Last: hardware that old wouldn't be able to slot enough ram to run it either... (by jonnin)
by PacR
Read nested structures from file.
Hi guyz im having trouble reading structures from text file containing: // this is example.txt structname1{ hp 50 mp 10 structname2{ ...
[19 replies] Last: As another take on this, consider: #include <iostream> #include <fs... (by seeplus)
How to find the Type of a struct that is passed as an argument and the template arguments for a lambda function?
The question I have pertains to the type of the structs that are passed as a function argument into this function template<class Arg> Result operator()(A...
[5 replies] Last: thanks for all the help (by lostwithcpp)
by cn00by
"large" project, crashes, variable "overlap", gdb
hello, i searching for days for an Segmentation fault. What i ve done: i try: - valgrind - gdb - comment the most c++ code out my problem, if i comme...
[1 reply] : The code that you have posted does not contain any header files. If t... (by Peter87)
how can I generalize a structure using templates?
Hi, This is something I don't want to write for each table in a database and am sure templates would be excellent for this kind of work.. but how? struct Pa...
[5 replies] Last: used templates! (by JUANDENT)
What is the difference between module partitions and submodules?
I have a module called math that export imports two submodules like this: export module math; export import math.one; export import math.two; I also ha...
[4 replies] Last: I haven’t touched modules yet. I'm working through some of the bas... (by George P)
cannot access OnEvent(Button&, int)!
class EmptyType {}; template < class TList, template <class AtomicType, class Base> class Unit, class Root = EmptyType > class Gen...
[2 replies] Last: thanks!! (by JUANDENT)
by Cplusc
Applying Boundary Condition
Firstly, I'd like to extend my apologies to anyone viewing this question, as it may not strictly pertain to programming. However, I'm posting it here in the hop...
[3 replies] Last: @Cplusc Ok, no worries. Have you made any progress using a debugger? (by TheIdeasMan)
A problem with GenLinearHierarchy from Alexandrescu's design
Hi, I am studying Andrei Alexandrescu's Modern C++ Design book and cannot access the OnEvent(Button&, int) implementation of: using linear = Loki::GenL...
[no replies]
Why does move not erase the source?
Hi, I have this code: vector<string> coll1 = { "Hello", "this", "is", "an", "example" }; list<string> coll2; move(coll1.begin(), coll1.end(), back_...
[9 replies] Last: thank you all!! (by JUANDENT)
  Archived months: [mar2024]