'Construct a source file (just like \'try_cpp()\'), run it through
the preprocessor, and return true if any line of the output matches
\'pattern\'.  \'pattern\' should either be a compiled regex object or a
string containing a regex.  If both \'body\' and \'headers\' are None,
preprocesses an empty file -- which can be useful to determine the
symbols the preprocessor and compiler set by default.'

def search_cpp(self, pattern, body=None, headers=None, include_dirs=None, lang='c'):

    self._check_compiler()
    (src, out) = self._preprocess(body, headers, include_dirs, lang)
    if isinstance(pattern, str):
        pattern = re.compile(pattern)
    file = open(out)
    match = False
    while True:
        line = file.readline()
        if (line == ''):
            break
        if pattern.search(line):
            match = True
            break
    file.close()
    self._clean()
    return match
