From 0003da04995e9254e32e002bbe33049ecaf09d9e Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@alchemyviewer.org>
Date: Mon, 29 Jun 2020 13:05:31 -0400
Subject: [PATCH] Rip out BOOST_FOREACH macro and replace with c++11 equivalent

---
 indra/llui/llcommandmanager.cpp               |  5 +---
 indra/llui/llfloater.cpp                      |  4 +--
 indra/llui/lllayoutstack.cpp                  | 29 ++++++++++---------
 indra/llui/llloadingindicator.cpp             |  3 +-
 indra/llui/llmenugl.cpp                       |  3 +-
 indra/llui/llnotifications.cpp                | 17 +++++------
 indra/llui/llnotificationslistener.cpp        |  3 +-
 indra/llui/lluicolortable.cpp                 |  3 +-
 indra/llui/llview.cpp                         | 27 +++++++++--------
 indra/llvfs/lldir.cpp                         |  9 +++---
 indra/newview/llagent.cpp                     |  3 +-
 indra/newview/llappearancemgr.cpp             |  5 ++--
 indra/newview/llappviewer.cpp                 | 15 +++++-----
 indra/newview/llconversationlog.cpp           |  3 +-
 indra/newview/llexternaleditor.cpp            |  2 +-
 indra/newview/llfloaterimcontainer.cpp        |  1 -
 indra/newview/llinventoryfunctions.cpp        |  2 --
 indra/newview/lllogchat.cpp                   |  5 ++--
 indra/newview/llmarketplacenotifications.cpp  |  3 +-
 indra/newview/llnotificationmanager.cpp       |  1 -
 indra/newview/lloutfitgallery.cpp             |  6 ++--
 indra/newview/llpanelexperiencelisteditor.cpp |  3 +-
 indra/newview/llpanelgroupbulkban.cpp         |  4 +--
 indra/newview/llviewermessage.cpp             |  5 ++--
 indra/test/test.cpp                           |  1 -
 25 files changed, 67 insertions(+), 95 deletions(-)

diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp
index 3e159365e5d..dd3c157c4be 100644
--- a/indra/llui/llcommandmanager.cpp
+++ b/indra/llui/llcommandmanager.cpp
@@ -34,9 +34,6 @@
 #include "llerror.h"
 #include "llxuiparser.h"
 
-#include <boost/foreach.hpp>
-
-
 //
 // LLCommandId class
 //
@@ -182,7 +179,7 @@ bool LLCommandManager::load()
 		return false;
 	}
 
-	BOOST_FOREACH(LLCommand::Params& commandParams, commandsParams.commands)
+	for (const LLCommand::Params& commandParams : commandsParams.commands)
 	{
 		LLCommand * command = new LLCommand(commandParams);
 
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 940dec02abd..5949633b637 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -58,8 +58,6 @@
 #include "llhelp.h"
 #include "llmultifloater.h"
 #include "llsdutil.h"
-#include <boost/foreach.hpp>
-
 
 // use this to control "jumping" behavior when Ctrl-Tabbing
 const S32 TABBED_FLOATER_OFFSET = 0;
@@ -2384,7 +2382,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent)
 			//{
 			//	floaterp->translate(translate_x, translate_y);
 			//}
-			BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents)
+			for (LLHandle<LLFloater> dependent_floater : floaterp->mDependents)
 			{
 				if (dependent_floater.get())
 				{
diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp
index 40a7324ac47..77baeeea7c0 100644
--- a/indra/llui/lllayoutstack.cpp
+++ b/indra/llui/lllayoutstack.cpp
@@ -381,8 +381,9 @@ void LLLayoutStack::updateLayout()
 
 	// first, assign minimum dimensions
 	LLLayoutPanel* panelp = NULL;
-	BOOST_FOREACH(panelp, mPanels)
+	for (auto it = mPanels.begin(), end = mPanels.end(); it != end; ++it)
 	{
+        panelp = *it;
 		if (panelp->mAutoResize)
 		{
 			panelp->mTargetDim = panelp->getRelevantMinDim();
@@ -400,7 +401,7 @@ void LLLayoutStack::updateLayout()
 	F32 fraction_distributed = 0.f;
 	if (space_to_distribute > 0 && total_visible_fraction > 0.f)
 	{	// give space proportionally to visible auto resize panels
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+		for (LLLayoutPanel* panelp : mPanels)
 		{
 			if (panelp->mAutoResize)
 			{
@@ -414,7 +415,7 @@ void LLLayoutStack::updateLayout()
 	}
 
 	// distribute any left over pixels to non-collapsed, visible panels
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+    for (LLLayoutPanel *panelp : mPanels)
 	{
 		if (remaining_space == 0) break;
 
@@ -430,7 +431,7 @@ void LLLayoutStack::updateLayout()
 
 	F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight();
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel *panelp : mPanels)
 	{
 		F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim);
 
@@ -516,7 +517,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const
 {
 	if (!panelp) return NULL;
 
-	BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+	for (LLLayoutPanel* p : mPanels)
 	{
 		if (p == panelp)
 		{
@@ -530,7 +531,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
 {
 	LLLayoutPanel* result = NULL;
 
-	BOOST_FOREACH(LLLayoutPanel* p, mPanels)
+	for (LLLayoutPanel *p : mPanels)
 	{
 		if (p->getName() == name)
 		{
@@ -544,7 +545,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c
 
 void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp)
 {
-	BOOST_FOREACH(LLLayoutPanel* lp, mPanels)
+	for (LLLayoutPanel* lp : mPanels)
 	{
 		if (lp->mResizeBar == NULL)
 		{
@@ -647,7 +648,7 @@ void LLLayoutStack::updateFractionalSizes()
 {
 	F32 total_resizable_dim = 0.f;
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -655,7 +656,7 @@ void LLLayoutStack::updateFractionalSizes()
 		}
 	}
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -676,7 +677,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 	S32 num_auto_resize_panels = 0;
 	F32 total_fractional_size = 0.f;
 	
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel* panelp : mPanels)
 	{
 		if (panelp->mAutoResize)
 		{
@@ -687,7 +688,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 
 	if (total_fractional_size == 0.f)
 	{ // equal distribution
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+        for (LLLayoutPanel *panelp : mPanels)
 		{
 			if (panelp->mAutoResize)
 			{
@@ -697,7 +698,7 @@ void LLLayoutStack::normalizeFractionalSizes()
 	}
 	else
 	{ // renormalize
-		BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+        for (LLLayoutPanel *panelp : mPanels)
 		{
 			if (panelp->mAutoResize)
 			{
@@ -714,7 +715,7 @@ bool LLLayoutStack::animatePanels()
 	//
 	// animate visibility
 	//
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+    for (LLLayoutPanel *panelp : mPanels)
 	{
 		if (panelp->getVisible())
 		{
@@ -861,7 +862,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect&
 		AFTER_RESIZED_PANEL
 	} which_panel = BEFORE_RESIZED_PANEL;
 
-	BOOST_FOREACH(LLLayoutPanel* panelp, mPanels)
+	for (LLLayoutPanel *panelp : mPanels)
 	{
 		if (!panelp->getVisible() || panelp->mCollapsed) 
 		{
diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp
index 1ede5b706f9..f79302f425a 100644
--- a/indra/llui/llloadingindicator.cpp
+++ b/indra/llui/llloadingindicator.cpp
@@ -34,7 +34,6 @@
 // Project includes
 #include "lluictrlfactory.h"
 #include "lluiimage.h"
-#include "boost/foreach.hpp"
 
 // registered in llui.cpp to avoid being left out by MS linker
 //static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator");
@@ -52,7 +51,7 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p)
 
 void LLLoadingIndicator::initFromParams(const Params& p)
 {
-	BOOST_FOREACH(LLUIImage* image, p.images().image)
+    for (LLUIImage* image : p.images().image)
 	{
 		mImages.push_back(image);
 	}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index 49b6bc763d7..0ae8bf6d895 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -60,7 +60,6 @@
 #include "v2math.h"
 #include <set>
 #include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
 
 // static
 LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL;
@@ -2114,7 +2113,7 @@ void LLMenuGL::arrange( void )
 		}
 		else
 		{
-			BOOST_FOREACH(LLMenuItemGL* itemp, mItems)
+            for (LLMenuItemGL* itemp : mItems)
 			{
 				// do first so LLMenuGLItemCall can call on_visible to determine if visible
 				itemp->buildDrawLabel();
diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp
index 4446a6e7f42..18fbdca5c12 100644
--- a/indra/llui/llnotifications.cpp
+++ b/indra/llui/llnotifications.cpp
@@ -45,7 +45,6 @@
 
 #include <algorithm>
 #include <boost/regex.hpp>
-#include <boost/foreach.hpp>
 
 
 const std::string NOTIFICATION_PERSIST_VERSION = "0.93";
@@ -443,14 +442,14 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par
 		mSoundName = p.sound;
 	}
 
-	BOOST_FOREACH(const LLNotificationTemplate::UniquenessContext& context, p.unique.contexts)
+	for (const LLNotificationTemplate::UniquenessContext& context : p.unique.contexts)
 	{
 		mUniqueContext.push_back(context.value);
 	}
 	
 	LL_DEBUGS() << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL;
 	
-	BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags)
+	for (const LLNotificationTemplate::Tag& tag : p.tags)
 	{
 		LL_DEBUGS() << "    tag \"" << std::string(tag.value) << "\"" << LL_ENDL;
 		mTags.push_back(tag.value);
@@ -1159,7 +1158,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p)
 	LLInstanceTracker<LLNotificationChannel, std::string>(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()),
 	mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString())
 {
-	BOOST_FOREACH(const std::string& source, p.sources)
+	for (const std::string& source : p.sources)
     {
 		connectToChannel(source);
 	}
@@ -1521,7 +1520,7 @@ void replaceFormText(LLNotificationForm::Params& form, const std::string& patter
 		form.ignore.text = replace;
 	}
 
-	BOOST_FOREACH(LLNotificationForm::FormElement& element, form.form_elements.elements)
+	for (LLNotificationForm::FormElement& element : form.form_elements.elements)
 	{
 		if (element.button.isChosen() && element.button.text() == pattern)
 		{
@@ -1569,19 +1568,19 @@ bool LLNotifications::loadTemplates()
 
 	mTemplates.clear();
 
-	BOOST_FOREACH(LLNotificationTemplate::GlobalString& string, params.strings)
+	for (LLNotificationTemplate::GlobalString& string : params.strings)
 	{
 		mGlobalStrings[string.name] = string.value;
 	}
 
 	std::map<std::string, LLNotificationForm::Params> form_templates;
 
-	BOOST_FOREACH(LLNotificationTemplate::Template& notification_template, params.templates)
+	for (LLNotificationTemplate::Template& notification_template : params.templates)
 	{
 		form_templates[notification_template.name] = notification_template.form;
 	}
 
-	BOOST_FOREACH(LLNotificationTemplate::Params& notification, params.notifications)
+	for (LLNotificationTemplate::Params &notification : params.notifications)
 	{
 		if (notification.form_ref.form_template.isChosen())
 		{
@@ -1635,7 +1634,7 @@ bool LLNotifications::loadVisibilityRules()
 
 	mVisibilityRules.clear();
 
-	BOOST_FOREACH(LLNotificationVisibilityRule::Rule& rule, params.rules)
+	for (LLNotificationVisibilityRule::Rule& rule : params.rules)
 	{
 		mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule)));
 	}
diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp
index be26416cbbf..f5447655dd7 100644
--- a/indra/llui/llnotificationslistener.cpp
+++ b/indra/llui/llnotificationslistener.cpp
@@ -32,7 +32,6 @@
 #include "llnotificationtemplate.h"
 #include "llsd.h"
 #include "llui.h"
-#include <boost/foreach.hpp>
 
 LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) :
     LLEventAPI("LLNotifications",
@@ -132,7 +131,7 @@ void LLNotificationsListener::listChannels(const LLSD& params) const
          cmi != cmend; ++cmi)
     {
         LLSD channelInfo, parents;
-        BOOST_FOREACH(const std::string& parent, cmi->getParents())
+        for (const std::string& parent : cmi->getParents())
         {
             parents.append(parent);
         }
diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp
index 244f0c6f009..c0ab83cf470 100644
--- a/indra/llui/lluicolortable.cpp
+++ b/indra/llui/lluicolortable.cpp
@@ -32,7 +32,6 @@
 #include "llui.h"
 #include "lluicolortable.h"
 #include "lluictrlfactory.h"
-#include <boost/foreach.hpp>
 
 LLUIColorTable::ColorParams::ColorParams()
 :	value("value"),
@@ -209,7 +208,7 @@ bool LLUIColorTable::loadFromSettings()
 
 	// pass constraint=LLDir::ALL_SKINS because we want colors.xml from every
 	// skin dir
-	BOOST_FOREACH(std::string colors_path,
+	for (const std::string& colors_path :
 				  gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS))
 	{
 		result |= loadFromFilename(colors_path, mLoadedColors);
diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp
index a31365f7f4d..e944e3cd2fd 100644
--- a/indra/llui/llview.cpp
+++ b/indra/llui/llview.cpp
@@ -32,7 +32,6 @@
 
 #include <sstream>
 #include <boost/tokenizer.hpp>
-#include <boost/foreach.hpp>
 #include <boost/bind.hpp>
 
 #include "llrender.h"
@@ -577,7 +576,7 @@ void LLView::deleteAllChildren()
 
 void LLView::setAllChildrenEnabled(BOOL b)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		viewp->setEnabled(b);
 	}
@@ -608,7 +607,7 @@ void LLView::onVisibilityChange ( BOOL new_visibility )
 #if AL_VIEWER_EVENT_RECORDER
 	BOOL log_visibility_change = LLViewerEventRecorder::getLoggingStatus();
 #endif
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		if (!viewp)
 		{
@@ -706,7 +705,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
 {
 	if ( getVisible() && getEnabled() )
 	{
-		BOOST_FOREACH(LLView* viewp, mChildList)
+		for (LLView* viewp : mChildList)
 		{
 			if ((viewp->*method)(c, mask, TRUE))
 			{
@@ -725,7 +724,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m
 template <typename METHOD, typename XDATA>
 LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -759,7 +758,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA
 
 LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -791,7 +790,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
 	// default to not accepting drag and drop, will be overridden by handler
 	*accept = ACCEPT_NO;
 
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -817,7 +816,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask,
 
 LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask)
 {
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -845,7 +844,7 @@ LLView*	LLView::childFromPoint(S32 x, S32 y, bool recur)
 	if (!getVisible())
 		return NULL;
 
-	BOOST_FOREACH(LLView* viewp, mChildList)
+	for (LLView* viewp : mChildList)
 	{
 		S32 local_x = x - viewp->getRect().mLeft;
 		S32 local_y = y - viewp->getRect().mBottom;
@@ -1355,7 +1354,7 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent)
 		mRect.mTop = getRect().mBottom + height;
 
 		// move child views according to reshape flags
-		BOOST_FOREACH(LLView* viewp, mChildList)
+		for (LLView* viewp : mChildList)
 		{
 			if (viewp != NULL)
 			{
@@ -1425,7 +1424,7 @@ LLRect LLView::calcBoundingRect()
 {
 	LLRect local_bounding_rect = LLRect::null;
 
-	BOOST_FOREACH(LLView* childp, mChildList)
+	for (LLView* childp : mChildList)
 	{
 		// ignore invisible and "top" children when calculating bounding rect
 		// such as combobox popups
@@ -1592,7 +1591,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
 	//if(name.empty())
 	//	return NULL;
 	// Look for direct children *first*
-	BOOST_FOREACH(LLView* childp, mChildList)
+	for (LLView* childp : mChildList)
 	{
 		llassert(childp);
 		if (childp->getName() == name)
@@ -1603,7 +1602,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const
 	if (recurse)
 	{
 		// Look inside each child as well.
-		BOOST_FOREACH(LLView* childp, mChildList)
+		for (LLView* childp : mChildList)
 		{
 			llassert(childp);
 			LLView* viewp = childp->findChildView(name, recurse);
@@ -2778,7 +2777,7 @@ S32	LLView::notifyParent(const LLSD& info)
 bool	LLView::notifyChildren(const LLSD& info)
 {
 	bool ret = false;
-	BOOST_FOREACH(LLView* childp, mChildList)
+	for (LLView* childp : mChildList)
 	{
 		ret = ret || childp->notifyChildren(info);
 	}
diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp
index f9ed402c9e7..9b02c09c67b 100644
--- a/indra/llvfs/lldir.cpp
+++ b/indra/llvfs/lldir.cpp
@@ -44,7 +44,6 @@
 #include "stringize.h"
 #include "llstring.h"
 #include <boost/filesystem.hpp>
-#include <boost/foreach.hpp>
 #include <boost/range/begin.hpp>
 #include <boost/range/end.hpp>
 #include <boost/assign/list_of.hpp>
@@ -689,10 +688,10 @@ void LLDir::walkSearchSkinDirs(const std::string& subdir,
 							   const std::string& filename,
 							   const FUNCTION& function) const
 {
-	BOOST_FOREACH(std::string skindir, mSearchSkinDirs)
+	for (const std::string& skindir : mSearchSkinDirs)
 	{
 		std::string subdir_path(add(skindir, subdir));
-		BOOST_FOREACH(std::string subsubdir, subsubdirs)
+		for (const std::string& subsubdir : subsubdirs)
 		{
 			std::string full_path(add(subdir_path, subsubdir, filename));
 			if (fileExists(full_path))
@@ -841,7 +840,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir,
 		// current language, copy them -- in proper order -- into results.
 		// Don't drive this by walking the map itself: it matters that we
 		// generate results in the same order as subsubdirs.
-		BOOST_FOREACH(std::string subsubdir, subsubdirs)
+		for (const std::string& subsubdir : subsubdirs)
 		{
 			StringMap::const_iterator found(path_for.find(subsubdir));
 			if (found != path_for.end())
@@ -853,7 +852,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir,
 
 	LL_DEBUGS("LLDir") << empty;
 	const char* comma = "";
-	BOOST_FOREACH(std::string path, results)
+	for (const std::string& path : results)
 	{
 		LL_CONT << comma << "'" << path << "'";
 		comma = ", ";
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 9f073714ad1..d16813a2b7c 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -94,7 +94,6 @@
 #include "llworld.h"
 #include "llworldmap.h"
 #include "stringize.h"
-#include "boost/foreach.hpp"
 #include "llcorehttputil.h"
 // [RLVa:KB] - Checked: 2011-11-04 (RLVa-1.4.4a)
 #include "rlvactions.h"
@@ -2163,7 +2162,7 @@ void LLAgent::endAnimationUpdateUI()
 			LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container");
 			LLFloaterIMContainer::floater_list_t conversations;
 			im_box->getDetachedConversationFloaters(conversations);
-			BOOST_FOREACH(LLFloater* conversation, conversations)
+			for (LLFloater* conversation : conversations)
 			{
 				LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL;
 				skip_list.insert(conversation);
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index bd28d5b699b..e547ea99fd4 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -27,7 +27,6 @@
 #include "llviewerprecompiledheaders.h"
 
 #include <boost/lexical_cast.hpp>
-#include <boost/foreach.hpp>
 #include "llaccordionctrltab.h"
 #include "llagent.h"
 #include "llagentcamera.h"
@@ -1642,7 +1641,7 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id)
         sub_cat_array,
         outfit_item_array,
         LLInventoryModel::EXCLUDE_TRASH);
-    BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+    for (LLViewerInventoryItem* outfit_item : outfit_item_array)
     {
         LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
         if (linked_item != NULL)
@@ -3603,7 +3602,7 @@ void update_base_outfit_after_ordering()
 								sub_cat_array,
 								outfit_item_array,
 								LLInventoryModel::EXCLUDE_TRASH);
-	BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+	for (LLViewerInventoryItem* outfit_item : outfit_item_array)
 	{
 		LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
 		if (linked_item != NULL)
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 8f588fe3e1f..967410cf652 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -143,7 +143,6 @@
 
 // Third party library includes
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 #include <boost/algorithm/string.hpp>
 #include <boost/regex.hpp>
 #include <boost/throw_exception.hpp>
@@ -1206,7 +1205,7 @@ bool LLAppViewer::init()
 		LLSD item(LeapCommand);
 		LeapCommand.append(item);
 	}
-	BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand))
+	for (const std::string& leap : llsd::inArray(LeapCommand))
 	{
 		LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL;
 		// We don't have any better description of this plugin than the
@@ -1718,7 +1717,7 @@ bool LLAppViewer::cleanup()
 		}
 		// Okay, now trash them all. We don't have to NULL or erase the entry
 		// in 'leaps' because the whole vector is going away momentarily.
-		BOOST_FOREACH(LLLeap* leap, leaps)
+		for (LLLeap* leap : leaps)
 		{
 			delete leap;
 		}
@@ -2327,7 +2326,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 		LL_ERRS() << "Invalid settings location list" << LL_ENDL;
 	}
 
-	BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
+	for (const SettingsGroup& group : mSettingsLocationList->groups)
 	{
 		// skip settings groups that aren't the one we requested
 		if (group.name() != location_key) continue;
@@ -2339,7 +2338,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 			return false;
 		}
 
-		BOOST_FOREACH(const SettingsFile& file, group.files)
+		for (const SettingsFile& file : group.files)
 		{
 			LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name()
 			    << " - from location " << location_key << LL_ENDL;
@@ -2403,11 +2402,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key,
 std::string LLAppViewer::getSettingsFilename(const std::string& location_key,
 											 const std::string& file)
 {
-	BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups)
+	for (const SettingsGroup& group : mSettingsLocationList->groups)
 	{
 		if (group.name() == location_key)
 		{
-			BOOST_FOREACH(const SettingsFile& settings_file, group.files)
+			for (const SettingsFile& settings_file : group.files)
 			{
 				if (settings_file.name() == file)
 				{
@@ -2953,7 +2952,7 @@ void LLAppViewer::initStrings()
 	// Now that we've set "[sourceid]", have to go back through
 	// default_trans_args and reinitialize all those other keys because some
 	// of them, in turn, reference "[sourceid]".
-	BOOST_FOREACH(std::string key, default_trans_args)
+	for (const std::string& key : default_trans_args)
 	{
 		std::string brackets(key), nobrackets(key);
 		// Invalid to inspect key[0] if key is empty(). But then, the entire
diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp
index 5539fa75dd4..95875660192 100644
--- a/indra/newview/llconversationlog.cpp
+++ b/indra/newview/llconversationlog.cpp
@@ -32,7 +32,6 @@
 #include "llnotificationsutil.h"
 #include "lltrans.h"
 
-#include <boost/foreach.hpp>
 #include "boost/lexical_cast.hpp"
 
 const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec
@@ -392,7 +391,7 @@ void LLConversationLog::deleteBackupLogs()
 	std::vector<std::string> backup_logs;
 	getListOfBackupLogs(backup_logs);
 
-	BOOST_FOREACH(const std::string& fullpath, backup_logs)
+	for (const std::string& fullpath : backup_logs)
 	{
 		LLFile::remove(fullpath);
 	}
diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp
index b66eb754a48..78884082929 100644
--- a/indra/newview/llexternaleditor.cpp
+++ b/indra/newview/llexternaleditor.cpp
@@ -93,7 +93,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::run(const std::string& file_path)
 	params.executable = mProcessParams.executable;
 
 	// Substitute the filename marker in the command with the actual passed file name.
-	BOOST_FOREACH(const std::string& arg, mProcessParams.args)
+	for (const std::string& arg : mProcessParams.args)
 	{
 		std::string fixed(arg);
 		LLStringUtil::replaceString(fixed, sFilenameMarker, file_path);
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 6abe6450434..45b419b9473 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -56,7 +56,6 @@
 #include "llworld.h"
 #include "llsdserialize.h"
 #include "llviewerobjectlist.h"
-#include "boost/foreach.hpp"
 
 //
 // LLFloaterIMContainer
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index eff069ae0ae..bdedfd695f7 100644
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -90,8 +90,6 @@
 #include "rlvlocks.h"
 // [/RLVa:KB]
 
-#include <boost/foreach.hpp>
-
 BOOL LLInventoryState::sWearNewClothing = FALSE;
 LLUUID LLInventoryState::sWearNewClothingTransactionID;
 std::list<LLUUID> LLInventoryAction::sMarketplaceFolders;
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index 0c64531783b..48d7e3b07cd 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -42,7 +42,6 @@
 #include <boost/algorithm/string/replace.hpp>
 #include <boost/regex.hpp>
 #include <boost/regex/v4/match_results.hpp>
-#include <boost/foreach.hpp>
 
 #if LL_MSVC
 #pragma warning(push)  
@@ -641,7 +640,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory,
 	std::string backupFileName;
 	unsigned backupFileCount;
 
-	BOOST_FOREACH(const std::string& fullpath, listOfFilesToMove)
+	for (const std::string& fullpath : listOfFilesToMove)
 	{
 		backupFileCount = 0;
 		newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos);
@@ -712,7 +711,7 @@ void LLLogChat::deleteTranscripts()
 	getListOfTranscriptFiles(list_of_transcriptions);
 	getListOfTranscriptBackupFiles(list_of_transcriptions);
 
-	BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions)
+	for (const std::string& fullpath : list_of_transcriptions)
 	{
 		S32 retry_count = 0;
 		while (retry_count < 5)
diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp
index 0886f9a9904..02bd9e1f342 100644
--- a/indra/newview/llmarketplacenotifications.cpp
+++ b/indra/newview/llmarketplacenotifications.cpp
@@ -33,7 +33,6 @@
 
 #include "llerror.h"
 
-#include <boost/foreach.hpp>
 #include <boost/signals2.hpp>
 
 
@@ -54,7 +53,7 @@ namespace LLMarketplaceInventoryNotifications
 			llassert(!no_copy_payloads.empty());
 			llassert(no_copy_cb_action != NULL);
 			
-			BOOST_FOREACH(const LLSD& payload, no_copy_payloads)
+			for (const LLSD& payload : no_copy_payloads)
 			{
 				(*no_copy_cb_action)(payload);
 			}
diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp
index a6f20a9f27f..55eb4ed7bd6 100644
--- a/indra/newview/llnotificationmanager.cpp
+++ b/indra/newview/llnotificationmanager.cpp
@@ -35,7 +35,6 @@
 #include "llnotifications.h"
 
 #include <boost/bind.hpp>
-#include <boost/foreach.hpp>
 
 using namespace LLNotificationsUI;
 
diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp
index ce4b405eb59..4accabbdddd 100644
--- a/indra/newview/lloutfitgallery.cpp
+++ b/indra/newview/lloutfitgallery.cpp
@@ -28,8 +28,6 @@
 #include "llviewerprecompiledheaders.h" // must be first include
 #include "lloutfitgallery.h"
 
-#include <boost/foreach.hpp>
-
 // llcommon
 #include "llcommonutils.h"
 #include "llvfile.h"
@@ -1058,7 +1056,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id)
             sub_cat_array,
             outfit_item_array,
             LLInventoryModel::EXCLUDE_TRASH);
-        BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array)
+        for (LLViewerInventoryItem* outfit_item : outfit_item_array)
         {
             LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem();
             LLUUID asset_id, inv_id;
@@ -1134,7 +1132,7 @@ void LLOutfitGallery::refreshTextures(const LLUUID& category_id)
 
     //Find texture which contain pending outfit ID string in name
     LLViewerInventoryItem* photo_upload_item = NULL;
-    BOOST_FOREACH(LLViewerInventoryItem* item, item_array)
+    for (LLViewerInventoryItem* item : item_array)
     {
         std::string name = item->getName();
         if (!mOutfitLinkPending.isNull() && name == mOutfitLinkPending.asString())
diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp
index 0fdb9a57f3e..b31e7f3bb56 100644
--- a/indra/newview/llpanelexperiencelisteditor.cpp
+++ b/indra/newview/llpanelexperiencelisteditor.cpp
@@ -40,7 +40,6 @@
 #include "lltextbox.h"
 #include "lltrans.h"
 #include "llsdutil.h"
-#include <boost/foreach.hpp>
 
 
 static LLPanelInjector<LLPanelExperienceListEditor> t_panel_experience_list_editor("panel_experience_list_editor");
@@ -96,7 +95,7 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience
 void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids )
 {
 	mExperienceIds.clear();
-	BOOST_FOREACH(LLSD uuid, llsd::inArray(experience_ids))
+	for (const LLSD& uuid : llsd::inArray(experience_ids))
 	{
 		// Using insert(range) doesn't work here because the conversion from
 		// LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry.
diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp
index cf1f0bc32f0..fe0e284f8b7 100644
--- a/indra/newview/llpanelgroupbulkban.cpp
+++ b/indra/newview/llpanelgroupbulkban.cpp
@@ -49,8 +49,6 @@
 #include "lluictrlfactory.h"
 #include "llviewerwindow.h"
 
-#include <boost/foreach.hpp>
-
 LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id)
 {
 	// Pass on construction of this panel to the control factory.
@@ -172,7 +170,7 @@ void LLPanelGroupBulkBan::submit()
 	}
 	if (group_datap)
 	{
-		BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList)
+		for (const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair : group_datap->mBanList)
 		{
 			const LLUUID& group_ban_agent_id = group_ban_pair.first;
 			std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id);
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 3e98d8ff900..706ae0808a2 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -123,7 +123,6 @@
 // [/RLVa:KB]
 
 #include <boost/algorithm/string/split.hpp> //
-#include <boost/foreach.hpp>
 
 #include "llnotificationmanager.h" //
 #include "llexperiencecache.h"
@@ -5827,7 +5826,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp
 		BOOL caution = FALSE;
 		S32 count = 0;
 		std::string perms;
-		BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS)
+		for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS)
 		{
 //			if ((orig_questions & script_perm.permbit)
 //				&& script_perm.caution)
@@ -6098,7 +6097,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data)
 		S32 known_questions = 0;
 		bool has_not_only_debit = questions ^ SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit;
 		// check the received permission flags against each permission
-		BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS)
+		for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS)
 		{
 			if (questions & script_perm.permbit)
 			{
diff --git a/indra/test/test.cpp b/indra/test/test.cpp
index ef7a121cf50..e248e721e51 100644
--- a/indra/test/test.cpp
+++ b/indra/test/test.cpp
@@ -70,7 +70,6 @@
 #include <boost/scoped_ptr.hpp>
 #include <boost/shared_ptr.hpp>
 #include <boost/make_shared.hpp>
-#include <boost/foreach.hpp>
 #include <boost/lambda/lambda.hpp>
 
 #include <fstream>
-- 
GitLab