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

  • prettydarknwild@lemmy.worldOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    i used tthe tester class with my code removing the .deallocate(), and although it doesnt crash, it still runs the destructor multiple times on the same element, i think its because im just pushing i into the container, and because that constructor creates an implicit conversion between int and ContainerTester, it creates a temporary object that gets destroyed once it is pushed into the deque, am i right?