Questions tagged [reference]
A reference is a value that enables a program to indirectly access a particular datum, such as a variable or a record, in the computer's memory or in some other storage device.
reference
17,281
questions
0
votes
1
answer
46
views
How to return a reference with lifetime from RefCell? [duplicate]
For example, I have the next structure:
struct MyStruct {
items: RefCell<HashMap<i32, SomeStruct>>,
}
impl MyStruct {
fn new() -> Self {
Self {
items: ...
0
votes
0
answers
79
views
Is it possible to merge a referenced query to it's source query in Power Query (Power Bi)?
Power Query doesn't let me merge a query to it's source query.
I tried merging both tables but the reference table doesn't show up as an option of tables to be joined.
The referenced query is a ...
1
vote
1
answer
51
views
Error returning a reference of an std::unordered_map with an std::unique_ptr
I'm wondering why do I have this error compiling the following example code:
#include <unordered_map>
#include <memory>
class OneClass
{
};
using TestUnorderedMap = std::unordered_map&...
0
votes
1
answer
48
views
Google Sheets Cell Reference Shifts When Deleting Column
I have a simple sheet where each column references the column before it. It is meant for a progressive budget to predict interest patterns.
Essentially, it follows this pattern:
Cell C2 has a ...
0
votes
0
answers
9
views
PYGTK: Referencing an existing object instance from another object?
I am trying to return an instance of an object to another object something like this:
`class object1():
attrib = '??'
def obj_instance(self):
return self
class object2():
obj1 = ...
2
votes
1
answer
65
views
Rust why does operator applied to a reference coerce, but let with an explicit type does not?
Consider the following code:
fn main() {
let foo = 1;
let bar: i32 = -&foo; //ok, -1
let baz: i32 = &foo; //error, expected `i32`, found `&{integer}`
let bad: i32 = !&...
0
votes
1
answer
71
views
Bad design for Rust program with lifetime and multiple references
I am implementing a graph data structure in Rust. For each node (and also edges - omitted from this snippet) in the graph I have a struct Algorithm (perhaps poorly named) that performs some node and ...
4
votes
1
answer
290
views
How to handle "reference to packed field is unaligned" error?
I am revisiting old code and am now encountering an error (synthetic recreation):
error[E0793]: reference to packed field is unaligned
--> src/main.rs:9:22
|
9 | println!("{:?}", ...
1
vote
3
answers
54
views
How can I reference the active cell within a loop through different sheets?
I am stuck where it is properly reading that I have two rows that fulfill the "If" condition, but it is copying row 1 both times on separate sheets, rather than row 8 and 10. Is there a way ...
1
vote
3
answers
70
views
Function overload resolution for template type parameters with respect to references and pointers
I've been working on some code as an exercise.
template <typename T> const T& larger(const T& a, const T& b) {
std::cout << "Calling larger(const T&, const T&)&...
0
votes
0
answers
26
views
Find the address of the hyperlink in a cell in excel with the VB code?
I am using following code to find the address but am unable to find the cell reference
For i = 5 To lastRow ' Assuming row 1 is header
' Get the cell containing the hyperlink in column S
Set ...
0
votes
1
answer
82
views
Size of a Kotlin class that contains custom objects as it's data members
I understand that in Kotlin(or Java) an object is a referenced type. i.e.
private var Object1: Obj1? = Obj1()
Here var Object1 is a reference(8 bytes) to the instance of class Obj1(on Heap).
Thus, If ...
0
votes
0
answers
45
views
a function returning a dereferenced pointer has type reference? [duplicate]
In the code repository I am working on, I found the following function:
const Type & (int n)
{
...
return *this;
}
A dereferenced pointer of type * Type has type Type. How can this function have ...
-1
votes
1
answer
80
views
Handle invalid variable name error in bash indirect references
Take a look at this simple example:
x="foo bar"
echo ${!x}
It erros: -bash: foo bar: invalid variable name.
I'm writing a script where a positional argument will indicate a "color name&...
0
votes
0
answers
32
views
Doxygen: show refs to file
I want to show references to a file in doxygen documentation.
SETUP
I have three files in a directory: main.c, req.yml and dox.cfg
main.c content:
#include <stdio.h>
/**
* @brief This function ...