C++ implementation progress - more test cases. Need to implement values() like
in the Java version.
C++ progress: sample_now and apply working now.