c++ initialize size of 3d vector

#include <iostream>
#include <vector>

int main() {
    int x_size = 2;
    int y_size = 3;
    int z_size = 4;

    std::vector<std::vector<std::vector<int>>> threeDVector(x_size, std::vector<std::vector<int>>(y_size, std::vector<int>(z_size)));

    return 0;
}