#include <algorithm>
#include <iostream>
#include <iterator>
#include <vector>

using namespace std;

struct Vector3 { float x, y, z; };

struct Mesh {
    vector<Vector3> positions;
    vector<int> indices;
};

ostream& operator<<(ostream& os, const Mesh& m) {
    for (const auto& pos : m.positions) cout << "(" << pos.x << ", " << pos.y << ", " << pos.z << "), ";
    for (const auto& index : m.indices) cout << index << ", ";
    cout << endl;
    return os;
}

int main() {
    // initialize a Mesh with explicit verts and indices
    Mesh myMesh { { { 0.f, 0.f, 0.f }, { 1.0f, 0.0f, 0.0f }, { 0.0f, 1.0f, 0.0f } }, 
                  { 0, 1, 2 } };
    
    // initialize a Mesh with iterator pairs
    Mesh mySecondMesh { { begin(myMesh.positions), end(myMesh.positions) },
                        { begin(myMesh.indices), end(myMesh.indices) } };
                        
    // initialize a Mesh as a copy of an existing mesh
    Mesh myThirdMesh = myMesh;
    
    cout << myMesh << mySecondMesh << myThirdMesh;
}
