Implementations of lifting-line theory predict the lift of a finite wing using a sheet of semi-infinite vortices extending from a vortex filament placed along the locus of aerodynamic centers of the wing. Prandtl's classical implementation is restricted to straight wings in flows without sideslip. In this work, it is shown that lifting-line theory can be extended to swept wings if, at the control points where induced velocity is calculated, the second derivative of the locus of aerodynamic centers is zero and the trailing vortices are perpendicular to the locus of aerodynamic centers. Therefore, a general implementation of lifting-line theory is presented that conditionally forces the second derivative of the locus of aerodynamic centers to zero at each control point and joints each trailing vortex such that there is a finite segment of the trailing vortex that lies perpendicular to the locus of aerodynamic centers. Consideration is given to modeling the locus of aerodynamic centers and section aerodynamic properties of swept wings. The resulting general formulation is analyzed to determine its sensitivity to closure parameters, accuracy, and numerical convergence.