+struct PointerTraits : PointerTraits
{ };
+template
+struct PointerTraits : PointerTraits
{ };
+template
+struct PointerTraits : PointerTraits
{ };
+// specialization to remove a reference attribute
+template
+struct PointerTraits : PointerTraits
{ };
+
+// specialization for raw pointers
+template
+struct PointerTraits
+{
+ typedef T element_type;
+ typedef T* pointer;
+ typedef T& reference;
+ typedef std::ptrdiff_t difference_type;
+
+ template
+ struct rebind_pointer
+ {
+ typedef U* type;
+ };
+
+ static pointer pointer_to (reference r)
+ {
+ return static_cast (
+ static_cast (
+ const_cast (
+ &reinterpret_cast (
+ r))));
+ }
+
+ template
+ static pointer static_cast_from (U* u)
+ {
+ return static_cast (u);
+ }
+
+ template
+ static pointer const_cast_from (U* u)
+ {
+ return const_cast (u);
+ }
+
+ template
+ static pointer dynamic_cast_from (U* u)
+ {
+ return dynamic_cast (u);
+ }
+};
+
+}
+}
+
+#endif
diff --git a/beast/mpl.h b/beast/mpl.h
new file mode 100644
index 0000000000..454f311741
--- /dev/null
+++ b/beast/mpl.h
@@ -0,0 +1,31 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_H_INCLUDED
+#define BEAST_MPL_H_INCLUDED
+
+#include "mpl/AddConst.h"
+#include "mpl/IfConst.h"
+#include "mpl/PointerToOther.h"
+#include "mpl/RemoveConst.h"
+#include "mpl/RemoveConstVolatile.h"
+#include "mpl/RemoveReference.h"
+#include "mpl/RemoveVolatile.h"
+
+#endif
diff --git a/beast/mpl/AddConst.h b/beast/mpl/AddConst.h
new file mode 100644
index 0000000000..4b25ecd0bd
--- /dev/null
+++ b/beast/mpl/AddConst.h
@@ -0,0 +1,38 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_ADDCONST_H_INCLUDED
+#define BEAST_MPL_ADDCONST_H_INCLUDED
+
+// Ideas based on boost
+
+namespace beast {
+namespace mpl {
+
+/// Add the `const` qualifier to a type.
+template
+struct AddConst
+{
+ typedef T const type;
+};
+
+}
+}
+
+#endif
diff --git a/beast/mpl/IfConst.h b/beast/mpl/IfConst.h
new file mode 100644
index 0000000000..19f73b021a
--- /dev/null
+++ b/beast/mpl/IfConst.h
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_IFCONST_H_INCLUDED
+#define BEAST_MPL_IFCONST_H_INCLUDED
+
+namespace beast {
+namespace mpl {
+
+// Ideas based on boost
+
+/// Select between T1 or T2 depending on Condition.
+/// @{
+template
+struct IfConst
+{
+ typedef T1 type;
+};
+
+template
+struct IfConst
+{
+ typedef T2 type;
+};
+/// @}
+
+}
+}
+
+#endif
diff --git a/beast/mpl/PointerToOther.h b/beast/mpl/PointerToOther.h
new file mode 100644
index 0000000000..868d46bb0f
--- /dev/null
+++ b/beast/mpl/PointerToOther.h
@@ -0,0 +1,68 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_POINTERTOOTHERH_INCLUDED
+#define BEAST_MPL_POINTERTOOTHERH_INCLUDED
+
+namespace beast {
+namespace mpl {
+
+// Ideas based on boost
+
+/** Declares a type which is a pointer or smart pointer to U, depending on T.
+ This works for smart pointer containers with up to three template
+ parameters. More specializations can be added for containers with
+ more than three template parameters.
+*/
+/// @{
+template
+struct PointerToOther;
+
+template class SmartPointer>
+struct PointerToOther , U>
+{
+ typedef SmartPointer type;
+};
+
+template class SmartPointer>
+struct PointerToOther , U>
+{
+ typedef SmartPointer type;
+};
+
+template class SmartPointer>
+struct PointerToOther , U>
+{
+ typedef SmartPointer type;
+};
+
+template
+struct PointerToOther
+{
+ typedef U* type;
+};
+/// @}
+
+}
+}
+
+#endif
diff --git a/beast/mpl/RemoveConst.h b/beast/mpl/RemoveConst.h
new file mode 100644
index 0000000000..4f555f26a8
--- /dev/null
+++ b/beast/mpl/RemoveConst.h
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_REMOVECONST_H_INCLUDED
+#define BEAST_MPL_REMOVECONST_H_INCLUDED
+
+// Ideas based on boost
+
+namespace beast {
+namespace mpl {
+
+/// Remove the `const` qualifier from a type.
+/// @{
+template
+struct RemoveConst
+{
+ typedef T type;
+};
+
+template
+struct RemoveConst
+{
+ typedef T type;
+};
+/// @}
+
+}
+}
+
+#endif
diff --git a/beast/mpl/RemoveConstVolatile.h b/beast/mpl/RemoveConstVolatile.h
new file mode 100644
index 0000000000..361f0255ac
--- /dev/null
+++ b/beast/mpl/RemoveConstVolatile.h
@@ -0,0 +1,43 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_REMOVECONSTVOLATILE_H_INCLUDED
+#define BEAST_MPL_REMOVECONSTVOLATILE_H_INCLUDED
+
+#include "RemoveConst.h"
+#include "RemoveVolatile.h"
+
+// Ideas based on boost
+
+namespace beast {
+namespace mpl {
+
+/// Remove both the `const` and `volatile` qualifiers from a type.
+template
+struct RemoveConstVolatile
+{
+ typedef typename RemoveConst <
+ typename RemoveVolatile ::type
+ >::type type;
+};
+
+}
+}
+
+#endif
diff --git a/beast/mpl/RemoveReference.h b/beast/mpl/RemoveReference.h
new file mode 100644
index 0000000000..239addcca7
--- /dev/null
+++ b/beast/mpl/RemoveReference.h
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_REMOVEREFERENCE_H_INCLUDED
+#define BEAST_MPL_REMOVEREFERENCE_H_INCLUDED
+
+namespace beast {
+namespace mpl {
+
+// Ideas based on boost
+
+/// Remove the reference qualifier from a type.
+/// @{
+template
+struct RemoveReference
+{
+ typedef T type;
+};
+
+template
+struct RemoveReference
+{
+ typedef T type;
+};
+/// @}
+
+}
+}
+
+#endif
diff --git a/beast/mpl/RemoveVolatile.h b/beast/mpl/RemoveVolatile.h
new file mode 100644
index 0000000000..26a848724e
--- /dev/null
+++ b/beast/mpl/RemoveVolatile.h
@@ -0,0 +1,46 @@
+//------------------------------------------------------------------------------
+/*
+ This file is part of Beast: https://github.com/vinniefalco/Beast
+ Copyright 2013, Vinnie Falco
+
+ Permission to use, copy, modify, and/or distribute this software for any
+ purpose with or without fee is hereby granted, provided that the above
+ copyright notice and this permission notice appear in all copies.
+
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+//==============================================================================
+
+#ifndef BEAST_MPL_REMOVEVOLATILE_H_INCLUDED
+#define BEAST_MPL_REMOVEVOLATILE_H_INCLUDED
+
+// Ideas based on boost
+
+namespace beast {
+namespace mpl {
+
+/// Remove the `volatile` qualifier from a type.
+/// @{
+template
+struct RemoveVolatile
+{
+ typedef T type;
+};
+
+template
+struct RemoveVolatile
+{
+ typedef T type;
+};
+/// @}
+
+}
+}
+
+#endif
diff --git a/modules/beast_core/beast_core.h b/modules/beast_core/beast_core.h
index babc3c9e7b..d15b155c9e 100644
--- a/modules/beast_core/beast_core.h
+++ b/modules/beast_core/beast_core.h
@@ -218,6 +218,13 @@ Some files contain portions of these external projects, licensed separately:
#undef _aligned_msize
#endif
+//------------------------------------------------------------------------------
+
+// New header-only library modeled more closely according to boost
+#include "../../beast/intrusive/ForwardList.h"
+
+//------------------------------------------------------------------------------
+
namespace beast
{
@@ -445,6 +452,4 @@ extern BEAST_API void BEAST_CALLTYPE logAssertion (char const* file, int line) n
#pragma warning (pop)
#endif
-//------------------------------------------------------------------------------
-
#endif