(a) No life insurance policy shall be issued or delivered in this state if it provides that on the death of anyone not specifically named therein, the owner or beneficiary of the policy shall receive the payment or granting of anything of value.
(b) This provision shall not be deemed to prohibit:
(1) The payment to policyholders or beneficiaries of sums representing in whole or in part gains to the insurer from mortality either in general or as resulting from particular classifications of policies;
(2) Family policies insuring unspecified members of a family; or
(3) Payments to unspecified beneficiaries of a class named by the insured.