Except where it is otherwise declared, the provisions of the foregoing titles of this part, in respect to the rights and obligations of parties to contracts, are subordinate to the intention of the parties, when ascertained in the manner prescribed by the chapter on the interpretation of contracts; and the benefit thereof may be waived by any party entitled thereto, unless such waiver would be against public policy.