
54 Cal.App.2d 178 (1942)
EDNA HEAPS, Appellant,
v.
HARVEY M. TOY, Respondent.
Civ. No. 11960. 
California Court of Appeals. First Dist., Div. One.  
Aug. 28, 1942.
 Vincent W. Hallinan and James A. Himmel for Appellant.
 Fabius T. Finch and Paul F. Fratessa for Respondent.
 KNIGHT, J.
 Plaintiff sued for damages for the alleged breach of an oral agreement she claimed defendant had entered into with her some seventeen years prior to the commencement of the action, concerning their future personal relations with each other. Defendant demurred to the complaint on general and special grounds, and the demurrer was sustained without leave to amend. Judgment of dismissal followed, and plaintiff appeals. Accepting as true the allegations of the complaint, it is apparent that the trial court was justified in holding that the agreement sued upon was void for two reasons: that it was in restraint of marriage, and was founded on a consideration contrary to good morals.
 [1] In said complaint plaintiff alleges that she was divorced in Seattle, Washington, in 1921, at the age of 25, and that there were two children (girls) aged 5 and 3 respectively; that shortly after the divorce was granted she left the children in Seattle and moved to San Francisco where she obtained employment in a candy concession in a hotel owned and operated by the defendant; that while so employed she became acquainted with the defendant; that he was about 38 years of age and married, and that "a strong friendship grew up" between them; that her purpose in moving to San Francisco was to gain a business education, establish herself in business and then bring her children to San Francisco to live with her; furthermore, that she "expected and hoped to re-marry with some suitable and desirable person and to rebuild her family upon such re-marriage"; that in accordance with such plan she attended a business school and afterward procured a notary public commission, and engaged in the business of public stenographer and notary in San Francisco; that meanwhile she became "friendly with certain desirable unmarried *180 men who wished to marry her and with one of whom she could have contracted marriage." She then goes on to allege that in that situation and about the year 1924 defendant represented to her that he was not living with his wife, that they had been separated for a long time and occupied separate homes, but that he had no grounds for a divorce and his wife would not procure one from him; that thereupon he made the following proposal to plaintiff: "that if plaintiff would forego marrying any other person and would give up her business career and would accept employment as a companion to defendant and would accept no other employment and would keep and maintain for defendant a home where he could live when he desired and where he could entertain his friends, and at which plaintiff would remain, that defendant would procure the removal of plaintiff's children to San Francisco and would maintain and support them here"; that he would purchase for and have granted to plaintiff a home, furnish and equip the same, and pay all taxes and insurance thereon; that he would support plaintiff "for the remainder of her life" and maintain and support her two children until they should become self-supporting or marry; furthermore that he would provide in his will for her care "as long as plaintiff should live"; and that he would cause a contract to that effect to be reduced to writing "as a guarantee of the permanency thereof." Continuing, she alleges that she "accepted said proposal of defendant" and "agreed to be thereafter and during the remainder of her life a companion of defendant to be with him at any time that he should desire, and to go with him to any and all places which he should choose, to keep and maintain for him a permanent home in which he could live at any time and to which he could bring any person for entertainment whenever it should please him"; that forthwith they "entered into said agreed relationship; that plaintiff moved to such places as defendant designated and maintained for him such facilities for living and entertaining as he desired and indicated and became his constant companion and accompanied him wherever he desired and forewent any opportunity to marry any other person and abandoned her said business and accompanied defendant on three trips to Europe and one to South America and in general devoted her entire time and efforts to the service of defendant in accordance with her agreement ..."; also that in pursuance of said agreement defendant brought *181 plaintiff's children to San Francisco and thereafter maintained them, and in the year 1928 purchased for and had conveyed to plaintiff residential property in San Francisco. It is then alleged that about the month of September, 1940, defendant repudiated said agreement and thereafter refused to pay for her maintenance and support, or the unpaid balance of $4,200 on the purchase price of the residential property. By reason of the foregoing plaintiff asked damages in the total sum of $164,200, which was made up of the following items: $60,000 for her future support and maintenance, computed on her expectancy of life, $4,200 to liquidate the unpaid balance on the residential property, and $100,000 as exemplary damages.
 Section 1676 of the Civil Code declares: "Every contract in restraint of the marriage of any person, other than a minor, is void." Here under the terms of the agreement as pleaded it was agreed that in consideration of the promises made by defendant to plaintiff she would not marry during the remainder of her life, or at least at any time prior to the termination of the agreement by the death of the defendant; and that "during the remainder of her life" she would be a companion to defendant. Obviously such an agreement falls squarely within the inhibition of the code section above quoted.
 Plaintiff contends that the condition that plaintiff refrain from marriage was no part of the contract itself; or if so that it is "a severable part" and consequently does not invalidate the entire contract. It clearly appears, however, from the allegations of the complaint that such condition was not only made part of the contract itself but was the real basis of the entire agreement. That being so it is not within the power of the courts to disregard it; in other words, courts may not, under the guise of judicial construction, rewrite a contract for the parties.
 Plaintiff contends that in any event the code section above quoted has no application to "second" marriages; that is, that it does not apply in cases of divorcees or widows. But as will be observed, said section in broad terms is made to apply to "the marriage of any person, other than a minor." (Italics ours.) If the Legislature had intended to exempt also from the operation of the section divorcees and widows, it doubtless would have inserted therein qualifying language *182 to that effect. The several cases cited by plaintiff from outside jurisdictions as supporting her contention are not in point. They involved devises and bequests, whereas here we are dealing with a contract, and of course fundamentally there is a vast difference between the law governing the right of a person to make a voluntary gift, testamentary or inter vivos, and the law governing the rights of two or more persons to enter into a contract. Said section 1676 is made part of the law of contracts of this state. It is placed among other code sections under the sub-title "Unlawful Contracts" (Title IV, div. 3, pt. 2, Civ. Code). It is therefore here controlling. Nor are we concerned with the law governing property settlements or agreements for maintenance and support entered into between husband and wife, for the reason that no such relationship existed between these contracting parties.
 Regarding the second ground of invalidity of the contract, section 1607 of the Civil Code provides that "The consideration of a contract must be lawful within the meaning of section sixteen hundred and sixty-seven" of said code; and the latter section declares: "That is not lawful which is: 1. Contrary to an express provision of law, 2. Contrary to the policy of express law, though not expressly prohibited; or, 3. Otherwise contrary to good morals." (Italics ours.) Here, assuming that the allegations of the complaint are true, it would appear that plaintiff entered into a life-long contract with a married man, whereby she agreed not only to refrain from marrying, but "to be thereafter and during the remainder of her life a companion of defendant" as long as he lived, to keep and maintain for him a "permanent" home to be supplied by him, and that she would "be with him at any time that he should desire, and ... go with him to any and all places which he should choose ..." Therefore, taking into consideration in connection therewith the allegations of the complaint concerning the personal relationship carried on between the parties during the sixteen or more years following the making of the contract, it would seem clear that the trial court was warranted in holding as a matter of law that the contract pleaded fell within the unlawful class contemplated by subdivision 3 of said section 1667.
 The judgment is affirmed.
 Peters, P. J., and Ward, J., concurred.
