Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) StdEndExample1

 

Technical facts

 

Operating system(s) or programming environment(s)

IDE(s):

Project type:

C++ standard:

Compiler(s):

Libraries used:

 

 

 

 

 

Qt project file: ./CppStdEndExample1/CppStdEndExample1.pro

 

TEMPLATE = app
CONFIG += console
CONFIG -= qt
QMAKE_CXXFLAGS += -std=c++11 -Wall -Wextra -Weffc++ -Werror
SOURCES += main.cpp

 

 

 

 

 

./CppStdEndExample1/main.cpp

 

#include <algorithm>
#include <cassert>
#include <vector>

int main()
{
  {
    int a[] { 2,1,0 };
    assert(!std::is_sorted(std::begin(a),std::end(a)));
    std::sort(std::begin(a),std::end(a));
    assert(std::is_sorted(std::begin(a),std::end(a)));
  }
  {
    std::vector<int> v { 2,1,0 };
    assert(!std::is_sorted(std::begin(v),std::end(v)));
    std::sort(std::begin(v),std::end(v));
    assert(std::is_sorted(std::begin(v),std::end(v)));
  }
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict

This page has been created by the tool CodeToHtml