In python the statement
pygments.highlight(fh_chunk.read(), CppLexer(), LatexFormatter(texcomments=True),sys.stdout)
resulted in the code line
being pygmentized as
whereupon latex emitted the error
! Missing $ inserted.
because of the underscore in "type_traits" is being interpreted as subscript. The error does not occur without "texcomments=true". Presumably "texcomments=true" should not affect anything but comments.