General C++ Programming - September 2022

C++ today
 
Hi everyone, I've been out of the scope from C++ for years and I would like to get back on it. I u...
[4 replies] Last: ... and there are a few decent libraries around on public git repos no... (by kbw)
Is md5 input plain limited to 32 chars ?
 
Hello all, in cannot understand why you can pass more than 32 characters into the md5 hash function...
[11 replies] Last: I use the MD5 from openssl. md5.hpp #pragma once #include <openssl/... (by kbw)
by new1
Random hex code generation saving
 
Hi, I'm trying to generate a hex random generators and catch it in 2d array. ex o/p random hex: ...
[6 replies] Last: Is there any better way for generation of hex As jonnin mentions if ... (by deleted account xyzzy)
by Cplusc
get a digit of an enum
 
hello forum I have a enum data type which is enum Type { D1Q3, D2Q9, D3Q19, D3Q27 }; The ...
[10 replies] Last: I really do not understand why the language is still missing simple en... (by helios)
ranges split
 
This code works as expected and produces the expected output: #include <string_view> #include <ra...
[8 replies] Last: For info, we've decided to use: template<typename T = std::string_v... (by seeplus)
by t im
About multi level pointer
 
Here is a code about multi level pointer: double* (*a) ; cout << sizeof(a) << endl; // 4 cou...
[2 replies] Last: Thanks a lot for your detailed reply. I got it. (by t im)
How can I create a concept that tests for specialization?
 
Hi, I want to create a concept that can only be applied to std::vector<T> for any T... Some p...
[4 replies] Last: Maybe in C++26... (by seeplus)
by t im
Decompose Number with Prime Factor
 
Given a number n, Here are two operations can be taken: * n - 1 * n divide by its prime factor Q...
[6 replies] Last: Oh, I misread that. (I’m bad at that, it seems.) (by Duthomhas)
Need g++ all compilation work files in some location
 
How do we put gcc/g++ all compilation work files in other certain directory ?
[1 reply] : The location and the names of auxiliary and dump outputs can be adjust... (by JLBorges)
Error in copying element of one array to another in C++
 
This is a very simple issue that for some reason I am not sure why I keep getting wrong. I am basica...
[6 replies] Last: You can do the copy with something like [ ] real_buffer from_plain_... (by mbozzi)
Loop by use of `:` specification and/or definition
 
What exactly is a c++ loop by use of : definition, how define its upper limit? is its equivalent to ...
[3 replies] Last: As described in that cppreference page, the for ( int i : n ) { cou... (by keskiverto)
creation of simple tree like structure using stl vector c++, need help : )
 
i would like to create a tree like structure in c++. since the number of children per node is ar...
[8 replies] Last: When we did this at Univ in the dim and distant past, we had the examp... (by seeplus)
What is an "exposition-only alias template"?
 
For instance at https://en.cppreference.com/w/cpp/iterator/forward_iterator: Definition of thi...
[2 replies] Last: well thanks (by JUANDENT)
About Base class call subclass function
 
like this code #include <iostream> class A{ public: A(){show();} virtual void show(){std::cout...
[13 replies] Last: Although this is OK, the inheritance relationship is wrong. B must inh... (by KaiTang)
A tool to have/look the C++ interpretation from a template?
 
Is there any tool to have/look the C++ interpretation from a template form syntax to its expansion/s...
[1 reply] : C++ Insights tries to do something like that: https://cppinsights.io/s... (by Peter87)
C++ template for function need be in compile time
 
is template for function changes syntax at compile time or no, e.g. template<bool o> test(int& pos...
[1 reply] : as o is a templated param, you use a constexpr if for it to be evaluat... (by seeplus)
On coming across #include <condition_variable>
 
Reading #include <condition_variable> on analyzing one's project code what is it all about witho...
[3 replies] Last: The condition_variable class is a synchronization primitive that can b... (by Geckoo)
Anonymous or no name namespace
 
Anyone outright understand what the necessary and purpose of bare, i.e. no name namespace ?
[4 replies] Last: unnamed namespace is not an alternative to a named namespace. It's an ... (by Cubbi)
integer hang forever
 
I am trying to solve the below problem, but my code hangs for ever and doesn't generate any output....
[12 replies] Last: Hi seeplus I was not aware about std::stoi(), until you told me. Anyh... (by leo2008)
what is the m()->v
 
On reading one's C++ code, wondering what exactly the below means (without yet finding his code line...
[5 replies] Last: I just wanted to have an object to return a pointer to. If you want yo... (by Peter87)
September 2022 Pages: 1234
  Archived months: [aug2022] [oct2022]

This is an archived page. To post a new message, go to the current page.