1,941 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
0
votes
0
answers
34
views
Setup Enterprise Github to be able to share a repository to organization
Our company uses Github Enterprize and created Organization for each unit.
However, when I tried to create a repository for a knowledge sharing workshop, I couldn't find a way to share a repository to ...
0
votes
2
answers
73
views
Adding members to an object with a loop
If I have an object that can accept multiple members of the same type E.g:
var transaction = new Transaction(arg1, arg2)
.WithHeader("Header Thing 1", "Header Thing 2&...
-3
votes
1
answer
140
views
Can I change a member variable of a struct using a std::map value? [closed]
There is a structure that has multiple const char* member variables.
typedef struct WWCryptoAuthorizationHeader
{
int age;
const char *name;
const char *address;
} StudentInfo;
There is a ...
-5
votes
3
answers
130
views
How to get member variable from another class in C++
I want to get public: member variable from another class.
But I can't get them. Would you direct me how to do it?
There is hand variable in each class User and Computer.
And I want to get them at ...
0
votes
1
answer
112
views
Assign reference parameter for ostream to reference member variable [duplicate]
I'm having trouble passing a reference to std::ostream to a class constructor and assigning it to a reference member variable.
I have two files:
// ./include/HelloWorld.hpp
#ifndef __HELLOWORLD_H__
#...
-3
votes
1
answer
134
views
Is the implicit parameter of a member function `this` or `*this`? [duplicate]
I was told that member function of a C++ class has an implicit parameter this which is a pointer to the object. But it seems to me that this parameter should be the object, not a pointer to it. For ...
0
votes
1
answer
222
views
The thread callback doesn’t seem run when I construct `std::jthread` as a local variable inside a method, why?
I'm struggling to re-learn C++ and I'm playing around with jthread at the moment.
I seem to have got things working when calling a class member function that I want on its own thread.
However, the ...
1
vote
2
answers
98
views
Decide on a templated class whether it holds 2 variables or just 1
I want to have a nested class B that behaves as follows:
if T is void, then B has only one member field sz and sizeof(B) == sizeof(sz)
otherwise, B has a member field sz and somehow obtains T
#...
1
vote
1
answer
66
views
Python member variables of different data types not getting updated in different thread with same priority
Consider this sample code:
class Test:
def __init__(self) -> None:
self.bool = False
self.string = ""
thread = Thread(target = self.target)
thread....
-1
votes
2
answers
130
views
Inheritance - is it possible to 'force' variable values relative to the derived class?
I am trying to create a simple model. A vehicle can only ever have 1 VehicleType, and a VehicleType is a Vehicle. As such I have created a base class Vehicle, and three derived classes Bike, Car, and ...
0
votes
1
answer
39
views
I am not able to initilize controller memeber in flutter, how can i fix it
import 'package:flutter/material.dart';
class Test extends StatelessWidget {
final controller;
final String hintText;
final bool obscureText;
const Test({
Key? key,
required ...
0
votes
1
answer
107
views
Why is decltype(member) not const while decltype((member)) is for const object and how does it impact function calls
I don't understand the behavior of the following snippet, which is an MRE derived from actual code:
#include <iostream>
#include <type_traits>
// It merely returns its input, which is a ...
0
votes
1
answer
72
views
Printing variables with member function does not give correct values [duplicate]
Running the program will take user input and validate, but does not print the expected information.
I can simply enter 5 for each dimension and 'blue' for color but then receive:
The length is: 2....
0
votes
0
answers
106
views
How to define size of class array parameter in source file? [duplicate]
Imagine I have this class.
Foo.hpp:
#pragma once
#include <cstdint>
class Foo {
static const std::size_t Size;
std::uint32_t buffer[Size];
};
I want to calculate Size in the source file, ...
1
vote
0
answers
536
views
Discord REST API get channel members
I build my python script, which check users in voice channel.
It's simply build for discord library like this:
client.get_guild(guild_id).get_channel(channel_id).members
and it's return all members ...