I have a code listing as shown in the picture (number 4) that goes a bit out of the margin although breaklines=true. When I try to break new line it gives me an error Listings Error: lstinline ended by EOL. How can I break this up so that the arguments line up in a more elegant way like:
computeInitialValues(const Query& query,
const std::vector<const Array*> &objects,
std::vector< std::vector<unsigned char>> &values,
bool &hasSolution)

EDIT: Code sample:
\documentclass[a4paper,11pt,twoside]{report}
\usepackage[left=2.5cm,right=2cm,top=2cm,bottom=2cm]{geometry}
\usepackage[T1]{fontenc}
\usepackage{amsmath, graphicx, tikz, enumerate, amssymb, pgf}
\usepackage{fancyhdr}
\usepackage{setspace}
\usepackage{pgfplots}
\usepackage{slashbox}
\usepackage{bchart}
\usepackage{float}
\usepackage{caption}
\raggedbottom
\usepackage[bottom]{footmisc}
\usepackage{listings}
\usepackage{color}
\usepackage{textcomp}
\definecolor{dkgreen}{rgb}{0,0.6,0}
\definecolor{gray}{rgb}{0.5,0.5,0.5}
\definecolor{mauve}{rgb}{0.58,0,0.82}
\lstset{
%frame=tb,
language=C++,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle=\ttfamily\footnotesize\bfseries,
numbers=none,
numberstyle=\tiny\color{gray},
commentstyle=\color{dkgreen},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
\begin{document}
\lstinline$bool computeInitialValues(const Query& query, const vector<const Array*>& objects, vector<vector<unsigned char>>& values, bool& hasSolution )$ computes the initial values for a list of objects.
\end{document}
\sloppyto allow breaks – Marco Daniel Aug 11 '12 at 10:55