Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!lll-winken!sun-barr!ccut!kogwy!new1!roger From: roger@zuken.co.jp (Roger Meunier) Newsgroups: comp.lang.c++ Subject: Re: #defines.... Message-ID: Date: 5 Jul 90 14:48:38 GMT References: <37786@genrad.UUCP> <5005@castle.ed.ac.uk> <303@taumet.com> Sender: news@new1.zuken.co.jp Organization: ZUKEN Inc. Yokohama, JAPAN Lines: 25 In-reply-to: steve@taumet.com's message of 4 Jul 90 17:08:49 GMT One thing I wish you could do with inline functions is declare global variables with a name passed as an argument. For example, with #define you can do the following: typedef enum { Type1,Type2,Type3 } DataType; class Data { DataType type; int value; ... } #define MakeOrange(name,v) Data name = { Type1, v } #define MakeApple(name,v) Data name = { Type2, v } MakeOrange(fruit1,100); MakeApple(fruit2,200); How could you do this with an inline function? (If someone says, "Use a constructor!" you've missed the point...) -- Roger Meunier @ Zuken, Inc. Yokohama, Japan (roger@zuken.co.jp)