Skip to main content
3 votes
2 answers
274 views

I see many places in public repositories, where the first and last iterators of std::vector/std::string/std::string_view are converted into pointers using the combination of &* operators. In ...
Fedor's user avatar
  • 24.7k
0 votes
0 answers
108 views

As far as I know, when I use * with &T, the result returned by * will be an Actual Value, not a Reference to that Value. I also know that * is actually a Method implemented for &T. I use ...
Phấn Đông Nguyên's user avatar
0 votes
1 answer
74 views

I would like to have a better understanding of the performance implications of choosing to write for x in &intoIterator versus for x in intoIterator in Rust. For the rest of this post, I refer to ...
Shane Bishop's user avatar
  • 5,052
10 votes
1 answer
741 views

Consider the following program: int main() { int* ptr = nullptr; return *ptr + 1; } (also on GodBolt) How is it, that with "decent" warnings enabled (-Wall -Wextra), both popular ...
einpoklum's user avatar
  • 137k
0 votes
0 answers
39 views

I am getting the following issues after running Klocwork Static Code Analysis on my code. I already added the null checks but still getting this issue. private void ShowUI(ShellWindow shell) { if (...
Kotarou's user avatar
4 votes
2 answers
200 views

So I've been doing some learning projects in c, and I'm starting to get more comfortable with pointers, however I have come across some phenomena that I can't seem to find much information for. ...
unnecessary_bootstrapping's user avatar
0 votes
0 answers
30 views

This is my first attempt at JSONata and I would appreciate any feedback. We have a bunch of bundled json schemas to process which need de-referencing. To illustrate, consider the simplified schema ...
PopGoesTheWza's user avatar
3 votes
2 answers
175 views

I am trying to create some C++ types that behave as containers but generate values on the fly (for efficiency reasons). Here is what I would ideally want (example with a container that generates zeros)...
pnarvor's user avatar
  • 170
1 vote
1 answer
148 views

#include <stdio.h> int main() { int arr[] = {1, 2, 3, 4, 5}; int *ptr = arr; printf("Pointer as int*: %p\n", (void*)ptr); printf("Pointer as char*: %p\n", (...
Alphin Thomas's user avatar
0 votes
1 answer
158 views

I have a pointer to a vector which I am passing into a function. The pointer is valid before being passed in, the pointer remains intact as it's being passed through, and printing it before and after ...
Coarse Rosinflower's user avatar
0 votes
1 answer
116 views

I'm reading linkedlist, an example of how to implement Iterator for a linked list from Brenden Matthews's Book Idiomatic Rust (Chapter 6). The complete code can be accessed from Source code the same ...
foehn's user avatar
  • 469
0 votes
0 answers
84 views

MSVC warned me about this code inside point_concept.hpp inside the class boost::geometry::concepts::Point: template <typename P, std::size_t Dimension, std::size_t DimensionCount> struct ...
TwistedBlizzard's user avatar
1 vote
2 answers
159 views

A pointer of arrays is indexed once to get the array, then indexed again to get the element. This C-style trick should work with {$POINTERMATH ON}, but it definitely doesn't: {$POINTERMATH ON} ... ...
Zoltán Bíró's user avatar
0 votes
3 answers
191 views

int x = 0; incrementX(&x); x has unexpected results at this point void incrementX(int* x) { // value in x stays 0 *x++; // value increments each time 1,2,3 ... *x+=1; } Why ...
developer68's user avatar
1 vote
1 answer
97 views

I have a callee function invoked by a caller function that modifies the contents of a member of a field in a union. This union is nested within a strut, and the struct is globally scoped. However, the ...
Elliott Goldstein's user avatar

15 30 50 per page
1
2 3 4 5
82