How Do I Distribute C++ Code?

I don’t know what you doing, but best way is to make a Plugin which can be enabled in any project:

Not sure how content distribution works with plugins right now, but i guess there might be ways to include demo project, you need to look up in market place information.

If you not aware of that yet, Projects and Plugins are just diffrent ways to place code and assets to engine in organized way, in reality your project and plugins creates one single engine in one body, in fact UE4 is first to introduce projects and plugins, before that you would need engine installation for each project (look UE3/UDK), you could imagine what pain it was.

Because of that C++ modules works the same regardless if they are n C++ project, plugin or part of engine source code so moving code to plugin should not be a problem (as long as you don’t change name of module), you probably only will need to change main module class because C++ project puts default game module template in it’s module, there a plugin wizard, you can use it to start plugin which should be good start.

Also “Blueprint Function Library” is nothing special, it’s purely cosmetic thing, it’s just place to put blueprint node static function unrelated to specific class, but nodes will work from any UObject class regardless where they are, it’s up to you how you organize your code.