Odpowiedź już padła, ale mógłbyś wygenerować wszystkie permutacje zbioru {1, 2, 3} (std::next_permutation) i następnie je losowo przemieszać (std::shuffle). Przykład kodu w C++20:
#include <iostream>
#include <algorithm>
#include <vector>
#include <random>
int main() {
std::vector nums{1, 2, 3};
std::vector permutations(1, nums);
while (std::ranges::next_permutation(nums).found) {
permutations.push_back(nums); }
std::default_random_engine gen{ std::random_device{}() };
std::ranges::shuffle(permutations, gen);
for (const auto& permutation : permutations) {
for (const auto& num : permutation) {
std::cout << num << " ";
} std::cout << "\n";
}
}