CPP/Boost/Signals2/Basic

From ProgrammingExamples

< CPP
Jump to: navigation, search

Basic.cpp

#include <boost/signals2/signal.hpp>
#include <iostream>
 
void func()
{
  std::cout << "Hello, world!" << std::endl;
}
 
int main()
{
  boost::signals2::signal<void ()> s;
  s.connect(func);
  s();
}

CMakeLists.txt

cmake_minimum_required(VERSION 2.6)
 
Project(Basic)
 
ADD_EXECUTABLE(Basic Basic.cpp)
#Note: Signals2 is header-only.
Personal tools