#include <iostream>
#include <vector>

int main() {
    std::vector<std::string> words={"This","is","just","a","trial!"};
    size_t i; //using the contiguous property of a vector:
    for (auto const& elem : words) {
    	i = &elem - &*words.begin();// or
    	i = &elem - &words.front();// or 
    	i = &elem - words.data();// or
    	i = std::addressof(elem) - std::addressof(words[0]); 
    	if(std::addressof(elem) == &words.front())
    	  std::cout << elem <<" (at"<<&elem<<") relative to ("<< &words[0] << ") takes position @#"<<i<< std::endl;
    	else std::cout << elem <<" (at"<<&elem<< ") takes position @#"<<i<< std::endl;
    }
	return 0;
}