##CS378 Summer 2015: Marek Bejda ##CS N378 Generic Programming and the STL Library Week 6

Utexas

We are finally reaching the end of the semester, with only about a week left. I’m finally seeing where the class is heading. We are diving deeper into iterators and building our iterator wrappers. It’s actually pretty neat building outputsreamiterators and reverseiterators. Yet it’s very sensitive and still confusing. When asked in class to build something simple as a constructor I went completely blank, even thought during the discussion I had a pretty good idea. During discussion I imagined the iterator using an index, which actually might be a little demanding. The solution that was brought up was using a temporary variable to hold the value, until the user accesses the value. Which now seems, clever since ++ is a much less demanding action than indexing via [].

The project, Graph, was pretty straight forward once we wrapped our heads around the data structure we were building. It became even easier once we started using little helper vertexes, one for vertices and one for edges. After that most method lines were about 2 lines.

##Tip of the Week:
Start using TravisCI without Sudo to access their new infrastructure and have faster build times! Sample .travis.yml

language: cpp
compiler: gcc
sudo: false
addons:
  apt: 
   sources: 
      - ubuntu-toolchain-r-test          
   packages:
      - gcc-4.8 
      - g++-4.8
      - gcov-4.6
      - clang
      - doxygen
      - valgrind
      - libgtest-dev
      - libboost-dev
 
before_script:
    - uname -a
    - printenv
    - clang++ --version 2>&1 | grep clang
    - g++ --version 2>&1 | grep g++
    - gcov --version | grep gcov
    - valgrind --version
    - grep "#define BOOST_VERSION " /usr/include/boost/version.hpp
    - doxygen --version

install: 
    # Install gtest without sudo 
    - mkdir ~/gtest && cd ~/gtest
    - export LIBRARY_PATH=$(pwd)
    - cp -r /usr/src/gtest/* ./
    - cmake -D CMAKE_INSTALL_PREFIX:PATH=./ ./
    - make
    - cd -

script:
    - ls -al
    - make Collatz.log
    - make collatz-tests
    - ls -al
    - make html
    - ls -al
    - make test
    - make clean
    - make test CXX=clang++
    - ls -al
    - make check