From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f5fe096935d4de21 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: argument of conversion cannot be an allocator Date: 1997/05/16 Message-ID: #1/1 X-Deja-AN: 241963484 References: <5lbccj$7vk$1@goanna.cs.rmit.edu.au> <5lganc$gjp$1@goanna.cs.rmit.edu.au> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-05-16T00:00:00+00:00 List-Id: Dale asks <> Not quite, obviously you cannot tell the type of "new x " by looking at it in isolation (it could be any of a number of different access types). So you can only use "new x" in contexts where you can figure out the required type using normal overloading rules, in a way that gives a unique answer. But in a type conversion, you only know what type you are going TO, not what you are coming from, so the type you are coming from must be uniquely determined by the expression being converted. I often find that people get type conversions and type qualiffication badly mixed up, and use the former when they want the latter. I think that is what happened to you in this case. For example, suppose we have two functions function f return integer; function f return real; then integer(f) is clearly illegal, since it is ambiguous, but integer'(f) is fine, and is the proper way of making sure you get the version of f you want. type conversions of pointers are unusual type qualifications of allocators are often required