Skip to main content
Advice
3 votes
2 replies
213 views

I have trouble understanding the C++ documentation. Will this cause a dangling pointer, or is it safe to do? I don't trust AI-generated information. #include <iostream> #include <vector> #...
Curious George's user avatar
2 votes
2 answers
145 views

I wrote a method that returns a reference to a variable (ref return), and sometimes the returned reference can be null. After calling this method I have to check if the reference is null, and I am ...
Theodor Zoulias's user avatar
2 votes
2 answers
168 views

I was surprised to get a deprecation warning from google benchmark function DoNotOptimize when calling it on a structured binding: benchmark::DoNotOptimize(const Tp&) [with Tp = int; typename std:...
Oersted's user avatar
  • 4,279
2 votes
1 answer
99 views

is there a way how to get updateable sheet name of the active or any other sheet without using scripts - only native formulae allowed and no hardcoding for example, in the spreadsheet there is a sheet ...
player0's user avatar
  • 132k
1 vote
0 answers
52 views

As I build a datagrid with elements that each have a command associated with them based on a template, I realized that I can't just have a DisplayAlert on the buttons that execute a command. I ...
Vlad SD's user avatar
  • 363
3 votes
2 answers
266 views

I'm trying to figure out how the signature of a completely transparent function might look. That is, a function that takes an argument T and that itself (i.e. from its return value) then looks exactly ...
Kamajii's user avatar
  • 1,935
2 votes
1 answer
90 views

I am trying to allow for the interface in an outer struct to allow using fields that it does not hold representing information of an inner struct. I will explain with an example because reading it ...
MrMoon01000010's user avatar
1 vote
1 answer
61 views

This works fine: fn main() { test1(); } fn test1() { let data = "data".to_string(); std::thread::scope(|scope| { scope.spawn(move || { println!("print ...
DanielV's user avatar
  • 675
-1 votes
2 answers
185 views

Having a Java and C background, I am currently learning C++ with an old but good book which explains that all members of a class including variables have to be declared but not initialized in its ...
Torsten Römer's user avatar
5 votes
1 answer
196 views

Consider the following code where I test whether a type is copy-assignable by using the std::is_copy_assignable_v type-trait: #include <print> #include <type_traits> struct IntProxy { ...
TemplateRex's user avatar
4 votes
3 answers
362 views

Consider the code below: for (T &t : some_vector_) { futures.push_back(thread_pool.submit([&t] { t.do_something(); })); } On some iteration i, t is initialized to a reference to a vector ...
Jack Humphries's user avatar
Best practices
0 votes
2 replies
93 views

I'm trying to make a struct that has dynamic methods by storing FnMuts in the struct. The FnMuts would be a function written in a scripting language like Python or Lua, but there might be some cases ...
Choosechee's user avatar
1 vote
1 answer
270 views

I am trying to create an event emitter similar to NodeJS: emitter.cc #include "event/emitter.h" namespace game { void Emitter::on(std::string eventName, Listener *listener) { std::list&...
Natan Camargos's user avatar
1 vote
1 answer
79 views

From references-change-permissions-on-places, places have three kinds of permission on their data: Read (R): data can be copied to another location. Write (W): data can be mutated. Own (O): data ...
Steven Lu's user avatar
  • 113
1 vote
1 answer
53 views

I would like to paste from one tab to the address of a cell in another tab, where the value changes. The problem I'm trying to solve is: how do I write the Apps Script code so that: var spreadsheet = ...
shacum's user avatar
  • 13

15 30 50 per page
1
2 3 4 5
1156