I understand that if the < operator is overloaded in C++ (for example, to insert custom structs into std::set), the implementation must be a strict weak order over the underlying type.
Consider the following struct and implementation.  This implementation is not a strict weak order, but the code compiles and runs without throwing an error (I would expect it to throw an error, given the requirement of a strict weak order):
#include <iostream>
#include <set>
using namespace std;
struct Pixel {
    int x;
    int y;
};
bool operator < (Pixel lhs, Pixel rhs){
    return lhs.x < rhs.x || lhs.y < rhs.y;
};
int main(){
    set<Pixel> mySet;
    Pixel *newPixelA = new Pixel;
    newPixelA->x = 1;
    newPixelA->y = 3;
    Pixel *newPixelB = new Pixel;
    newPixelB->x = 4;
    newPixelB->y = 2;
    mySet.insert(*newPixelA);
    mySet.insert(*newPixelB);
}
Is this the expected behavior? EDIT: using Xcode.
 
     
     
    