« first day (1493 days earlier)      last day (1364 days later) » 

12:03 AM
Hi folks, anyone here have experience porting old old C++ code to newer version? I'm a JavaScript developer and have little experience with strongly typed nor compiled Software and I can only imagine the horrors that lie ahead if I move forward with helping with this... but I figured I'd check if it's all that bad.
 
12:17 AM
For context: the code is mostly >20 years old (Jagged Alliance 2) - so perhaps it's a terrible idea in the first place - or maybe it's just some search and replace for deprecated functions. Figured I'd ask. ^.^
 
12:36 AM
Alright, think I found an answer... stackoverflow.com/a/2974793/2848941
 
 
5 hours later…
5:47 AM
@Julix porting old C++ to compile on newer compilers can be difficult if there was a bunch of compiler specific extensions used. If it was all standards compliant, it shouldn't be too hard
also, for older projects "refactoring" is rarely worth it unless you plan on doing a lot of maintenance for a longer time after the initial port
 
 
7 hours later…
12:23 PM
Could someone please explain me this part from en.cppreference.com/w/cpp/language/value_initialization about Value Initialization. It says: "if T is a class type with no default constructor or with a user-provided or deleted default constructor, the object is default-initialized;". To begin with, how can a object of type class be default-initialized if the class has no default constructor and has some non-trivial constructor for example ?
Or how could it be default-initialized if it has deleted default constructor ?
 
nwp
@domocar1 They probably mean something like this.
I would have expected this to be aggregate initialization, but apparently it is not.
 
12:51 PM
Yeah, I see now. Thanks
 
 
3 hours later…
3:44 PM
Hello, I cannot find answers to the following question that seems trivial: If you want to implement a linked list whose node are polymorphic, how do you manage the allocations ? I mean: if the code that add a new node is placed in the base class, how can it know that it should allocate the derived class ? I am able to solve the problem using templating (Node<T> or CRTP) but I would like to see how to do without.
 
 
2 hours later…
6:01 PM
Hey, does anyone know what's the most convenient way to print out the contents of an array in C++? In Java, I will do Arrays.toString(arr). I came from Java or Javascript background, so not sure with C++
 
@PrashinJeevaganth use a loop, convert the elements to a string then print
 
 
5 hours later…
11:05 PM
Mornings. I'm trying to use a rust crate, boscop/web-view, on windows 10. After installing relevant things using win-builds and the Windows 10 SDK, I get a cargo:warning=webview_edge.cpp:15:38: fatal error: winrt/Windows.Foundation.h: No such file or directory
I could confirm the existence of that header file and tried to add the parent directory to the PATH hoping that it would see it, to no success
I'm not completely sure what I'm supposed to be doing here, would anyone have a general direction in which I could google? so far the Windows.Foundation.h not being found results I've found were either far too obscure for me to digest or didn't seem to have been answered.
(I'm asking here because as far as I can tell, this error happens while cargo is compiling c++ files)
 

« first day (1493 days earlier)      last day (1364 days later) »