• 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
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)
1D FFTs of an Eigen tensor
 
So I am trying to take an FFT along a specific direction of an Eigen tensor, similarly to my code in MATLAB. In MATLAB: Nx = 8; Ny = 6; Nz= 8; Lx =6; Ly =...
[10 replies] Last: I was trying to take the 1D FFT along each direction separately to un... (by JamieAl)
C++23 Formatting Ranges
 
C++23 added the ability to "print out" using formatting options a container directly instead of having to use some form of a loop to access each element individ...
[5 replies] Last: I would recommend two books, one on C++20 and the other on C++23, by t... (by George P)
by Zaap
vector push_back passing size from 0 to overflow
 
Hi, please see the following code and the associated prints. I also add the Argument class below. Basically, it crashes the second time it goes in the loop b...
[3 replies] Last: Bumping this to just give some insight that might be generally helpful... (by Ganado)
The object itself (this) is it a leak if its constructor throws?
 
if the ctor throws, then the object this has already received the memory (some new or alloc has been executed)... so, does the object this leak? the only possi...
[7 replies] Last: Excellent comments! Thank you again!! (by JUANDENT)
Convert MATLAB function to C++
 
I have a function from a textbook: https://people.maths.ox.ac.uk/trefethen/spectral.html Basically it calculates the Chebyshev differentiation matrix and I hav...
[14 replies] Last: @mbozzi I think the problem is that duyk is too small to hold the en... (by JamieAl)
by Zaap
Threading: changing processor count does not change performances
 
Hi, I've been doing some multi-threading in my program. This program essentially iterates over a dataset and for each line computes some stuff. My multi-t...
[8 replies] Last: [quote=Zaap]I think using a for_each in my code will create an excessi... (by TheIdeasMan)
Why is my fft function not working as expected?
 
Trying to take the fft of 2D array along one direction (x for example and not y) so it's a 1D FFT of 2D array. I have done this successfully before using Eigen ...
[9 replies] Last: it makes no difference whether you store your matrix row or column maj... (by jonnin)
Cyclic dependencies - how to deal with them?
 
Hi, I have a class GridCtrl that delegates to GridCtrlHandler but GridCtrlHandler must also be able to call methods on GridCtrl. I cannot have GridCtrl.h ...
[6 replies] Last: Heh, I created a circular dependency issue using modules and Visual St... (by George P)
why use decltype(auto) return type instead of auto?
 
Hi, I have this code namespace detail { template <class F, class Tuple, std::size_t... I> decltype(auto) apply_impl(F&& f, Tuple&& t, std::index_sequence<I....
[3 replies] Last: I swear modern C++ is a minefield Too bad there's no golden idol acr... (by George P)
Pages: 12
  Archived months: [feb2024]