
please wait
by malibor
Potentially-evaluated expressions
|
An expression is potentially evaluated unless it is the operand of the sizeof, noexcept, typeid, decltype etc.. https://en.cppreference.com/w/cpp/language/ex... |
Mar 31, 2023 at 10:30am
[19 replies] Last: [quote=malibor] static_assert is a good trick to see if it's evaluate... (by Peter87)
|
by JUANDENT
parsing durations using %q or %Q??
|
cannot parse durations using %q or %Q...e.g. std::chrono::duration<long long, std::milli> dur{ 1200 }; std::istringstream sm{ "1000ms" }; auto str =... |
Mar 29, 2023 at 1:03pm
[5 replies] Last: Maybe something like: #include <chrono> #include <iostream> #includ... (by seeplus)
|
by JUANDENT
parsing a formatted string
|
using the format library in C++20, and having done this: int val = 25; string str = std::format( "{0:2}", val); How can we get the val from str, somethin... |
Mar 27, 2023 at 4:01pm
[6 replies] Last: To just obtain a number from std::string, there are the stoxxx functio... (by seeplus)
|
by JUANDENT
I don't understand ISO week
|
Please explain why Sunday jan 1, 2023 prints as 52 using %V -- why is that different to week 1? week 1 starts with Jan 1 for every year... Doesn't make... |
Mar 26, 2023 at 6:05pm
[1 reply] : [quote=JUANDENT]week 1 starts with Jan 1 for every year... Nope. Eve... (by Peter87)
|
by JUANDENT
now() returns same as current_zone()->to_local(now())
|
Hi, system_clock::now() returns the same value as chr::current_zone()->to_local(now()); I expected now() to return UTC value and to->local(now()) to return CS... |
Mar 26, 2023 at 2:07am
[1 reply] : A quick search reveals: https://en.cppreference.com/w/cpp/chrono/utc_... (by TheIdeasMan)
|
by malibor
Should destructors be noexcept?
|
I'm working on a library which whose classes are almost all hierarchical, problem is that if upmost class destructor is declared noexcept then all destructors i... |
Mar 25, 2023 at 2:32pm
[13 replies] Last: There is nothing in the C++ standard that demands that this should ge... (by malibor)
|
by shekharsahoo
Need Help to find the error
|
I have below code, for functor. But this is giving compilation error in VS17. #include <iostream> #include <functional> template <typename T> struct less... |
Mar 24, 2023 at 6:48am
[3 replies] Last: Now I understand, the problem. Yes thanks to both of you for the clari... (by shekharsahoo)
|
by JUANDENT
where can I find trim() in std C++?
|
I expected std::string to have a member function trim() but it does not. How to accomplish this?? |
Mar 23, 2023 at 10:31am
[4 replies] Last: Using ranges, then possibly something like this which will trim white-... (by seeplus)
|
by JUANDENT
is this object dangling?
|
hi, I have this code assert(ltrim_copy(str) == "¢4,500.55"); // line 1 ltrim_copy returns a temporary object... is it ok to compare it with... |
Mar 22, 2023 at 11:44pm
[1 reply] : it's OK and it is destroyed when assert returns. (by malibor)
|
by LukeProducts
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... |
Mar 22, 2023 at 7:03pm
[4 replies] Last: You implementation is missing a "Neuron" class, "Layer" class, "Synaps... (by malibor)
|
by JUANDENT
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);... |
Mar 22, 2023 at 1:46pm
[8 replies] Last: [quote=seeplus]In my mind (and the language lawyers will probably squa... (by Peter87)
|
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... |
Mar 20, 2023 at 3:32pm
[10 replies] Last: > Actually this is not a big code at all Big enough for you to dump on... (by salem c)
|
by seeplus
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... |
Mar 19, 2023 at 1:08pm
[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 ... |
Mar 18, 2023 at 8:22am
[4 replies] Last: vcpkg is used with Visual Studio. step 1: install all deps with corre... (by malibor)
|
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... |
Mar 17, 2023 at 10:00pm
[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... |
Mar 15, 2023 at 7:17pm
[18 replies] Last: I would strongly appreciate any idea on my way of generating mesh insi... (by Cplusc)
|
by seeplus
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... |
Mar 15, 2023 at 5:40pm
[9 replies] Last: [quote=seeplus]When do you get 8 for sys_days? libstdc++ (64-bit) htt... (by Peter87)
|
by seeplus
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 ... |
Mar 15, 2023 at 4:42pm
[4 replies] Last: I get forward thinking & future planning, but c++ has no business stan... (by jonnin)
|
by JUANDENT
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 |
Mar 14, 2023 at 7:16am
[3 replies] Last: https://en.cppreference.com/w/cpp/types/numeric_limits/digits10 (by Peter87)
|
by allenmaki
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... |
Mar 13, 2023 at 6:48pm
[6 replies] Last: What exactly do you want to know? Let's say your terminal/cmd has 100 ... (by Ganado)
|