From: john s. <sk...@us...> - 2008-03-23 09:42:53
|
On 23/03/2008, at 5:39 PM, Erick Tryzelaar wrote: > On Sat, Mar 22, 2008 at 11:04 PM, john skaller > <sk...@us...> wrote: >> Well, why is this? Seems like a missing header file or something? >> Isn't getBitWidth a 'const' member of llvm::Type? > > Nope, it's just for llvm::IntegerType: > > http://llvm.org/doxygen/classllvm_1_1IntegerType.html > > llvm::FloatType is an instance of llvm::Type, so it doesn't have that > function. I should have been a little more clear. What I wanted was > for accessing get_integer_width with a type_ should be a type error, > but it seems like felix is letting this through. Maybe due to those > checks you disabled? > > I'll update the post to be a little more clear. No need, I understand. Clearly, you should not use the default definition, that should fix it. Typeclasses are the same as C++ templates, instances as specialisations, the default typeclass definition is the body of the master template, if you don't want it to be used for all types without specialisations, don't provide it. That forces an instantiation time error. |