reorder friend to be compatible with clang++