Q:

Creating a new C++ subvector?

Say I have a vector with values [1,2,3,4,5,6,7,8,9,10]. I want to create a new vector that refers to, for example, [5,6,7,8]. I imagine this is just a matter of creating a vector with pointers or do I have to push_back all the intermediary values I need?

A:

One of std::vector's constructor accepts a range:
std::vector<int> v;

// Populate v.
for (int i = 1; i <= 10; i++) v.push_back(i);   

// Construct v1 from subrange in v.
std::vector<int> v1(v.begin() + 4, v.end() - 2);

A:

You don't have to use push_back if you don't want to, you can use std::copy:
std::vector<int> subvector;
copy ( v1.begin() + 4, v1.begin() + 8, std::back_inserter(subvector) );

A:

This is fairly easy to do with std::valarray instead of a vector:
#include <valarray>
#include <iostream>
#include <iterator>
#include <algorithm>

int main() {
  const std::valarray<int> arr={0,1,2,3,4,5,6,7,8,9,10};

  const std::valarray<int>& slice = arr[std::slice(5, // start pos
                                                   4, // size
                                                   1  // stride
                                                  )];

}

Which takes a "slice" of the valarray, more generically than a vector.
For a vector you can do it with the constructor that takes two iterators though:
const std::vector<int> arr={0,1,2,3,4,5,6,7,8,9,10};
std::vector<int> slice(arr.begin()+5, arr.begin()+9);

