This was the single most problematic thing across C++ compilers and standards.
Foregoing it means a hassle, but using it turned out to be worse.
#include "scm-hash.hh"
#include "warn.hh"
+const char * const All_font_metrics::type_p_name_ = 0;
+
Index_to_charcode_map const *
All_font_metrics::get_index_to_charcode_map (const string &filename,
int face_index,
All_font_metrics (All_font_metrics const &);
public:
+ static const char * const type_p_name_; // = 0
SCM mark_smob () const;
Index_to_charcode_map const *get_index_to_charcode_map (const string &filename,
Callback_wrapper (void (*trampoline) (SCM, SCM)) : trampoline_ (trampoline)
{ } // Private constructor, use only in make_smob
public:
+ static const char * const type_p_name_; // = 0
LY_DECLARE_SMOB_PROC (&Callback_wrapper::call, 2, 0, 0)
SCM call (SCM target, SCM ev)
{
class Paper_outputter : public Smob<Paper_outputter>
{
public:
+ static const char * const type_p_name_; // = 0
SCM mark_smob () const;
virtual ~Paper_outputter ();
private:
struct Scale : public Smob<Scale>
{
+ static const char * const type_p_name_; // = 0
virtual ~Scale ();
Scale (vector<Rational> const &);
Scale (Scale const &);
class Scheme_hash_table : public Smob1<Scheme_hash_table>
{
public:
+ static const char * const type_p_name_; // = 0
int print_smob (SCM, scm_print_state *) const;
bool try_retrieve (SCM key, SCM *val);
bool contains (SCM key) const;
static int print_trampoline (SCM, SCM, scm_print_state *);
static void smob_proc_init (scm_t_bits) { };
- // type_p_name_ can be overriden in the Super class with a static
- // const char [] string. This requires both a declaration in the
- // class as well as a single instantiation outside. Using a
- // template specialization for supplying a different string name
- // right in Smob_base<Super> itself seems tempting, but the C++
- // rules would then require a specialization declaration at the
- // class definition site as well as a specialization instantiation
- // in a single compilation unit. That requires just as much source
- // code maintenance while being harder to understand and quite
- // trickier in its failure symptoms when things go wrong. So we
- // just use a static zero as "not here" indication.
- static const int type_p_name_ = 0;
+ // type_p_name_ has to be defined in the Super class, either with a
+ // static const char [] string or as a null pointer of type const
+ // char *. We used to provide a default here for convenience, but
+ // battling the various conflicting C++ standards was too much of a
+ // hassle.
// LY_DECLARE_SMOB_PROC is used in the Super class definition for
// making a smob callable like a function. Its first argument is a
{
vector<Engraver_dispatch_entry> dispatch_entries_;
public:
+ static const char * const type_p_name_; // = 0
void apply (Grob_info);
SCM static create (SCM trans_list,
SCM iface_list, Direction);
#include "listener.hh"
+const char * const Callback_wrapper::type_p_name_ = 0;
+
const char Listener::type_p_name_[] = "ly:listener?";
#include "lily-imports.hh"
+const char * const Paper_outputter::type_p_name_ = 0;
+
Paper_outputter::Paper_outputter (SCM port, const string &format)
{
file_ = port;
return SCM_UNSPECIFIED;
}
+const char * const Scale::type_p_name_ = 0;
+
int
Scale::step_count () const
{
#include <cassert>
+const char * const Scheme_hash_table::type_p_name_ = 0;
+
SCM
Scheme_hash_table::make_smob ()
{
#include "engraver.hh"
+const char * const Engraver_dispatch_list::type_p_name_ = 0;
+
void
Engraver_dispatch_list::apply (Grob_info gi)
{
class Unpure_pure_call : public Smob1<Unpure_pure_call>
{
public:
+ static const char * const type_p_name_; // = 0
// Smob procedures unfortunately can only take at most 3 SCM
// arguments. Otherwise we could use a "3, 0, 1" call signature and
// not require an argument count check of our own.
}
};
+const char * const Unpure_pure_call::type_p_name_ = 0;
+
SCM
Unpure_pure_container::pure_part () const
{