summaryrefslogtreecommitdiff
path: root/examples/hello_world.cc
blob: 6a171abfdbddda928b0d43c2d6607b76fe5d7564 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* Copyright 2003 - 2016, The libsigc++ Development Team
 *
 *  Assigned to the public domain.  Use as you wish without
 *  restriction.
 */

#include <iostream>
#include <string>

#include <sigc++/sigc++.h>

void
on_print(const std::string& str)
{
  std::cout << str;
}

int
main()
{
  sigc::signal<void(const std::string&)> signal_print;

  signal_print.connect(sigc::ptr_fun(&on_print));

  signal_print.emit("hello world\n");

  return 0;
}