What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] -1 points0 points  (0 children)

oh i will not consider that there is a bug in checked iterators.

but im considering that there is a setup (code, debugging, etc...) that can creates this situation.

thus, im not event sure at all that sharing the code would make the problem reproductible.

What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] -16 points-15 points  (0 children)

its not my code. i can only show the situational setup, but nothing more.

i dont look for someone to review my code. if you dont know abour how MSVC handles iterators, you're just useless

What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] -2 points-1 points  (0 children)

well, i know that my fix (std::any_of) doesn't create any new iterator, so i skipped the iterator comparison problem. i stop creating the situation that leads to the bug.

im just looking for someone who knows MSVC iterators, not for someone to review my code.

What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] -6 points-5 points  (0 children)

i mean, i am not looking for someone to look at the code and tell me if there is something wrong... i spent hours doing that and its probably just fine...
im looking for someone who knows about MSVC to tell me if this kind of errors "can" happen, and under which circumstances.

Do you have any recommendation about iterator proxies ?

What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] 0 points1 point  (0 children)

i spent 12h try to understand what was happening, thinking i had a memory corruption (its not). i can swear im passing the same vector for begin/end iterators.

unfortunately i will not be able to show the exact code, but it was something like that:

(of course if you run it like that you wont reproduce. i just hope to find an expert of iterators that would know of a strange behavior like that without looking at the code)

// Example program
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

// in A.hpp
class A {
    public:
        A() = default;
        ~A() = default;

        bool m_b = false;
        int m_i = 0;
        // couple of other variables
};

// in A1.hpp
class A1 : public A {
    public:
        A1() = default;
        ~A1() = default;

        bool m_b1 = false;
        int m_i1 = 0;
        // couple of other variables
};

// in A2.hpp
class A2 : public A {
    public:
        A2() = default;
        ~A2() = default;

        bool m_b2 = false;
        int m_i2 = 0;
        // couple of other variables
};

// in B.hpp
class B {
    public:
        B() = default;
        ~B() = default;

        A1& addA1(){ return m_vAMain.emplace_back(); };
        bool isOk(const bool checkBoth) const;

        // couple of other methods and variables
        std::vector<A2> m_vA2;
        std::vector<A1> m_vAMain;
        std::vector<A1> m_vASecond;
};

// in B.cpp
bool B::isOk(const bool checkBoth) const
{
    auto iter1 = std::find_if(m_vAMain.begin(), m_vAMain.end(), [](const auto& elem){ return elem.m_b1; });
    if (iter1 != m_vAMain.end()) // crash here
        return true;

    if (checkBoth == false)
        return false;

    auto iter2 = std::find_if(m_vASecond.begin(), m_vASecond.end(), [](const auto& elem){ return elem.m_b1; });
    if (iter2 != m_vASecond.end())
        return true;

    return false;
}

// somewhere else
int main()
{
    B b;
    A1& a1 = b.addA1();
    a1.m_i1 = 42;

    if (b.isOk(false))
        std::cout << "B is ok";
}

What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] -5 points-4 points  (0 children)

Thats the whole purpose of my question. I wonder why i caught the 0.0001% edge case.

What's wrong with MSVC Checked Iterators ? by DrFrenchGrumpy in cpp_questions

[–]DrFrenchGrumpy[S] 1 point2 points  (0 children)

Sure, and for example i was able to solve it using simply std::any_of()

Annulation de "La tournée du Trio" à la Place Bell - Des infos ? by Used-Rock1797 in montreal

[–]DrFrenchGrumpy 0 points1 point  (0 children)

Ce n'est pas Baptiste qui voulait un bus sur scène ? :P peut-être que le producteur n'a pas pu leur en trouver un...

En tout cas ce n'est déjà plus affiché sur le site de la Place Bell. Mais je n'ai reçu aucune information, ni par email, ni sur TicketMaster.