this post was submitted on 24 Sep 2023
0 points (NaN% liked)

C++

1709 readers
8 users here now

The center for all discussion and news regarding C++.

Rules

founded 1 year ago
MODERATORS
 

i was trying to create a deque, and when the function that resizes the array is excuted, it crashes with the error from the title, and when i delete the deallocate() it stops happening, what im doing wrong? code: https://pastebin.com/0yHHcLnj

you are viewing a single comment's thread
view the rest of the comments
[โ€“] prettydarknwild@lemmy.world 0 points 11 months ago (1 children)

dont worry, i have one more question, i should initialize variables with = or with {}?

[โ€“] ratatosk@feddit.de 0 points 11 months ago* (last edited 11 months ago)

Direct initialization is recommended over copy initialization (=).

Okay, to be fair: it's some sort of holy war, the answer depends on who you ask.