packageName

Get the full package name for the given symbol.

template packageName () {
enum bool isNotFunc;
static if(__traits(compiles, parentOf!T))
enum parent;
static if(!(__traits(compiles, parentOf!T)))
enum string parent;
static if(isNotFunc && T.stringof.startsWith("package "))
enum packageName;
static if(!(isNotFunc && T.stringof.startsWith("package ")))
static if(parent)
enum packageName;
}

Examples

static assert(packageName!packageName == "std");
static assert(packageName!moduleName == "std");

Meta