aboutsummaryrefslogtreecommitdiff
path: root/examples/cxx/hybrid/filter/people-custom-pimpl.cxx
blob: e8a096f7858d8a37e8061028ff641497b2314980 (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
// file      : examples/cxx/hybrid/filter/people-custom-pimpl.cxx
// author    : Boris Kolpackov <boris@codesynthesis.com>
// copyright : not copyrighted - public domain

// Include people-pimpl.hxx (which includes people-custom-pimpl.hxx)
// instead of people-custom-pimpl.hxx.
//
#include "people-pimpl.hxx"

void people_pimpl::
age_filter (unsigned short min, unsigned short max)
{
  min_age_ = min;
  max_age_ = max;
}

void people_pimpl::
person (const ::person& p)
{
  // Check if the age constraints are met.
  //
  unsigned short age = p.age ();

  if (age >= min_age_ && age <= max_age_)
    people_base_pimpl::person (p);
}