Direct and generalized synthesis of carbon-based yolk–shell nanocomposites from metal-oleate precursor