• 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]
Optimization using OpenMP: Parallel code is slow
 
I have a made a post in the past about optimization and parallelization where I got lots of help and feedback. I am attempting to use openMP with FFTW library a...
[8 replies] Last: I notice you were able to pass Eigen matrix to fftw_plan_dft_r2c_3d ... (by mbozzi)
how can a function name be an lvalue?
 
take this function: int abs(int a) { return a < 0 ? -a : a; } abs is supposed to be an lvalue but it cannot be assigned!! int xy(int);...
[5 replies] Last: See this table that describes the C++17 taxonomy for value categories:... (by mbozzi)
Neuronal Network not working properly..
 
Dear Community, I'm wondering what I'm doing wrong when it comes to building neural networks and I can't come up with a solution on my own. I want to build a...
[no replies]
by Cplusc
blockMesh generator
 
Following my question regarding hexahedral mesh generation in a domain using the STL file representing the surface triangulation here https://cplusplus.com/foru...
[10 replies] Last: > Actually this is not a big code at all Big enough for you to dump on... (by salem c)
by PeteDD
Please critique... vector of structures with std::function and virtual class methods.
 
Two parts... First the explanation then, in the "reply", my attempt at a solution. I would greatly appreciate critique on the code I came up with. I am conti...
[7 replies] Last: a lamda has to be created for each of the class methods and I will us... (by coder777)
Age calculation
 
With C++20/23 std::chrono and a birthdate as either type sys_days or year_month_day, is there any 'easy' way to obtain their age as years, months and days. It's...
[1 reply] : We've come up with this: struct Age { unsigned years {}; unsigned... (by seeplus)
by Cplusc
Building project from github
 
I'm trying to build this project https://github.com/hemelb-codes/hemelb. This project has several dependencies. I have several of them installed in my system ...
[4 replies] Last: vcpkg is used with Visual Studio. step 1: install all deps with corre... (by malibor)
Force implicit conversion of a string literal in templated class?
 
The code below doesn't compile because string literal instead of std::string is given to constructor. #include <string> #include <type_traits> template<typ...
[3 replies] Last: C++17! https://en.cppreference.com/w/cpp/language/class_template_argu... (by mbozzi)
by Cplusc
generate mesh inside .STL file
 
I have some STL files (usually aneurysm) and I'm using Lattice Boltzmann Method for my simulation and I need to construct the mesh. As far as LBM uses cubic mes...
[18 replies] Last: I would strongly appreciate any idea on my way of generating mesh insi... (by Cplusc)
year_month_day vs sys_days
 
When dealing with dates - year, month, day (not times) - either year_month_day or sys_days can be used. Is there guidance as when one or the other should be use...
[9 replies] Last: [quote=seeplus]When do you get 8 for sys_days? libstdc++ (64-bit) htt... (by Peter87)
Chrono date literals
 
Since C++20 there has been the d and y literals defined in <chrono> - but no m. This seems to be able to be added by (for VS - based upon the code for d and ...
[4 replies] Last: I get forward thinking & future planning, but c++ has no business stan... (by jonnin)
How can I find the maximium number of decimal digits representable in a double?
 
What is the maximum precision of double? numeric_limits<double>::????? default precision is 6 digits after the period
[3 replies] Last: https://en.cppreference.com/w/cpp/types/numeric_limits/digits10 (by Peter87)
output will show only the end.
 
Hello everybody. I really thank you for helping me to go back to programming in C++. You know I am now 73 years old. They told me I have to stay busy to sta...
[6 replies] Last: What exactly do you want to know? Let's say your terminal/cmd has 100 ... (by Ganado)
Boost logging library
 
may i please inquire re/ Boost logging library . a cursory reading of the manual indicates it merely stores strings of the programmer's choosing . i wish to uti...
[2 replies] Last: This is one kind of workflow where you might want to record inputs to ... (by salem c)
Undefined reference when using generics
 
Recently my class started to dig deeper into working with generics and templates for Java. Since I'm still learning C++, I thought it would be a nice learning e...
[3 replies] Last: You're not using generics. Generics are a different concept in other H... (by IWishIKnew)
same function name different signature
 
Why the following code does not compile in g++? struct A { int foo(int x) { return x * 2; } }; struct B: A { int foo(int x, int y) { ...
[3 replies] Last: Can also specify to use foo() in A explicitly: struct A { int foo(... (by seeplus)
output read string between getchar() calls
 
Hello mates, i dont understand what my code is doning and why. #include <iostream> int main() { std::string msg; int c; while ((c = getchar())...
[8 replies] Last: if i replace getchar() with getch() from conio.h, i dont get any key ... (by seeplus)
by Cplusc
if condition for class constructor
 
I'm trying to have a class constructor in an if condition but the compiler dos not accept that. here is the code, LattModel::LattModel() :VelocitySet( { 4....
[2 replies] Last: Ops,you're right. I should've used macro instead of if condition.Thank... (by Cplusc)
by wk1999
asio coroutine timer
 
I am being confused the asio::timer coroutine does not work if I modify the timer in another coroutine: The "Leave foo" never reached: Enter foo Enter ba...
[2 replies] Last: The timer will expire in function bar: timer.expires_after(asio::chron... (by wk1999)
Pages: 123
  Archived months: [jan2023]